diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-16 15:05:16 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-16 15:05:16 +0400 |
commit | 0621225b38731a8217a03bea3b82e74f2cda10d2 (patch) | |
tree | 56f5984ca79e7bb5042e25240405aed6c6cf569a /source/blender/editors/interface/view2d.c | |
parent | 9f2a13b263bb0e3f27352bb3e37cab219e8af322 (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/blender/editors/interface/view2d.c')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 9 |
1 files changed, 4 insertions, 5 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; |