Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_console/space_console.c')
-rw-r--r--source/blender/editors/space_console/space_console.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index c8fa049f5eb..5a965fc076b 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -138,8 +138,17 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
wmKeyMap *keymap;
ListBase *lb;
+ const int prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */
+
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
+ /* always keep the bottom part of the view aligned, less annoying */
+ if(prev_y_min != ar->v2d.cur.ymin) {
+ const float cur_y_range= ar->v2d.cur.ymax - ar->v2d.cur.ymin;
+ ar->v2d.cur.ymin= prev_y_min;
+ ar->v2d.cur.ymax= prev_y_min + cur_y_range;
+ }
+
/* own keymap */
keymap= WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);