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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-07-16 15:05:16 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-16 15:05:16 +0400
commit0621225b38731a8217a03bea3b82e74f2cda10d2 (patch)
tree56f5984ca79e7bb5042e25240405aed6c6cf569a /source
parent9f2a13b263bb0e3f27352bb3e37cab219e8af322 (diff)
2.5 - View2D fixes for User Prefs
Added NULL check for View2D code for invalid style pointer (this underlying problem should get addressed at some point), and reinstated the reinitialisation hack for panel regions.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/view2d.c9
-rw-r--r--source/blender/editors/screen/area.c6
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 2f92901c8f5..0f7532383c9 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -254,6 +254,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* panels view, with horizontal/vertical align */
case V2D_COMMONVIEW_PANELS_UI:
{
+ float panelzoom= (style) ? style->panelzoom : 1.0f;
+
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
v2d->keepzoom= (V2D_KEEPASPECT|V2D_KEEPZOOM);
v2d->minzoom= 0.5f;
@@ -271,13 +273,10 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
v2d->tot.ymin= -winy;
v2d->cur.xmin= 0.0f;
- v2d->cur.xmax= winx*style->panelzoom;
-
- v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= -winy*style->panelzoom;
+ v2d->cur.xmax= winx*panelzoom;
v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= -winy*style->panelzoom;
+ v2d->cur.ymin= -winy*panelzoom;
}
break;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index efd8754a760..e84aab787c1 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1256,9 +1256,11 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
ListBase *keymap;
// XXX quick hacks for files saved with 2.5 already (i.e. the builtin defaults file)
+ // scrollbars for button regions
ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
- //if(!(ar->v2d.align & V2D_ALIGN_NO_POS_Y))
- // ar->v2d.flag &= ~V2D_IS_INITIALISED;
+ // correctly initialised User-Prefs?
+ if(!(ar->v2d.align & V2D_ALIGN_NO_POS_Y))
+ ar->v2d.flag &= ~V2D_IS_INITIALISED;
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy);