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:
authorTon Roosendaal <ton@blender.org>2012-10-25 16:53:27 +0400
committerTon Roosendaal <ton@blender.org>2012-10-25 16:53:27 +0400
commit0405406280027b93d390f91047502fc53da20ebc (patch)
tree53786b8360d89b515b35c3a48a850ef75074f2e2
parent2505984b52862a4aa74af37e41d6ebdccc3c266f (diff)
Bugfix #28298
When I added DPI support in the UI, I added code that refreshes views for 2d regions. These refreshes also happened on screen switches or file select, causing header views (horizontal scrolled) to clear. Now the code less intrusive, changing header views in fewer cases. This is a patch provided by Anthony Edlin. Thanks dude!
-rw-r--r--source/blender/editors/interface/view2d.c10
-rw-r--r--source/blender/editors/screen/area.c6
2 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 559602b04c0..fb7a2615583 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -476,8 +476,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
if (winy < v2d->oldwiny) {
float temp = v2d->oldwiny - winy;
- cur->ymin += temp;
- cur->ymax += temp;
+ if (v2d->align & V2D_ALIGN_NO_NEG_Y) {
+ cur->ymin -= temp;
+ cur->ymax -= temp;
+ }
+ else { /* Assume V2D_ALIGN_NO_POS_Y or combination */
+ cur->ymin += temp;
+ cur->ymax += temp;
+ }
}
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index eb08ba7d92e..c0f8da89306 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1259,10 +1259,6 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
/* prevent uiblocks to run */
uiFreeBlocks(NULL, &ar->uiblocks);
}
-
- /* rechecks 2d matrix for header on dpi changing, do not do for other regions, it resets view && blocks view2d operator polls (ton) */
- if (ar->regiontype == RGN_TYPE_HEADER)
- ar->v2d.flag &= ~V2D_IS_INITIALISED;
}
}
@@ -1775,7 +1771,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
}
/* always as last */
- UI_view2d_totRect_set(&ar->v2d, maxco + UI_UNIT_X + 80, BLI_rctf_size_y(&ar->v2d.tot));
+ UI_view2d_totRect_set(&ar->v2d, maxco + UI_UNIT_X + 80, headery);
/* restore view matrix? */
UI_view2d_view_restore(C);