[Bf-blender-cvs] [2d973f4] master: Fix T47047: Toolbars opening at maximum zoom level
Campbell Barton
noreply at git.blender.org
Fri Jan 8 20:08:42 CET 2016
Commit: 2d973f44e2fd47fa2fd4c1f59247c56517fcb26c
Author: Campbell Barton
Date: Sat Jan 9 05:42:37 2016 +1100
Branches: master
https://developer.blender.org/rB2d973f44e2fd47fa2fd4c1f59247c56517fcb26c
Fix T47047: Toolbars opening at maximum zoom level
There were 2 issues:
- toolbars were set initialized in user-defaults
so their scroll & zoom level were set.
- initializing new 2d views included the scroll width,
which scaled the new views zoom level, especially when dragging out.
===================================================================
M source/blender/blenloader/intern/versioning_defaults.c
M source/blender/editors/interface/view2d.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index e57a215..7ea26ea 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -175,11 +175,10 @@ void BLO_update_defaults_startup_blend(Main *bmain)
/* Remove all stored panels, we want to use defaults (order, open/closed) as defined by UI code here! */
BLI_freelistN(&ar->panels);
- /* simple fix for 3d view properties scrollbar being not set to top */
- if (ar->regiontype == RGN_TYPE_UI) {
- float offset = ar->v2d.tot.ymax - ar->v2d.cur.ymax;
- ar->v2d.cur.ymax += offset;
- ar->v2d.cur.ymin += offset;
+ /* some toolbars have been saved as initialized,
+ * we don't want them to have odd zoom-level or scrolling set, see: T47047 */
+ if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) {
+ ar->v2d.flag &= ~V2D_IS_INITIALISED;
}
}
}
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 9976f42..6425475 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -211,7 +211,12 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
uiStyle *style = UI_style_get();
do_init = (v2d->flag & V2D_IS_INITIALISED) == 0;
-
+
+ /* initialize without scroll bars (interfears with zoom level see: T47047) */
+ if (do_init) {
+ v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR | V2D_SCROLL_HORIZONTAL_FULLR;
+ }
+
/* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
switch (type) {
/* 'standard view' - optimum setup for 'standard' view behavior,
@@ -322,16 +327,15 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
if (do_init) {
float panelzoom = (style) ? style->panelzoom : 1.0f;
- float scrolw = (v2d->scroll & V2D_SCROLL_RIGHT) ? V2D_SCROLL_WIDTH : 0.0f;
v2d->tot.xmin = 0.0f;
- v2d->tot.xmax = winx - scrolw;
+ v2d->tot.xmax = winx;
v2d->tot.ymax = 0.0f;
v2d->tot.ymin = -winy;
v2d->cur.xmin = 0.0f;
- v2d->cur.xmax = (winx) * panelzoom - scrolw;
+ v2d->cur.xmax = (winx) * panelzoom;
v2d->cur.ymax = 0.0f;
v2d->cur.ymin = (-winy) * panelzoom;
More information about the Bf-blender-cvs
mailing list