diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 21 |
2 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f2bab0284a2..52250ca2559 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -941,7 +941,7 @@ void uiRegionPanelLayout(const bContext *C, ARegion *ar, int vertical, char *con block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS, UI_HELV); if(vertical) - w= (ar->type->minsizex)? ar->type->minsizex-12: ar->winx-12; + w= (ar->type->minsizex)? ar->type->minsizex-12: block->aspect*ar->winx-12; else w= (ar->type->minsizex)? ar->type->minsizex-12: UI_PANEL_WIDTH-12; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 34c8bfaab74..3b503f00fd3 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -155,6 +155,23 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) { short tot_changed= 0; + /* XXX always set state vars for buttonsview, this is hardcoded */ + switch (type) { + /* panels view, with free/horizontal/vertical align */ + case V2D_COMMONVIEW_PANELS_UI: + { + /* 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; + v2d->maxzoom= 2.0f; + + v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y); + v2d->keeptot= V2D_KEEPTOT_BOUNDS; + } + break; + } + + /* initialise data if there is a need for such */ if ((v2d->flag & V2D_IS_INITIALISED) == 0) { /* set initialised flag so that View2D doesn't get reinitialised next time again */ @@ -257,12 +274,12 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) case V2D_COMMONVIEW_PANELS_UI: { /* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */ - v2d->keepzoom= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT|V2D_KEEPZOOM); + v2d->keepzoom= (V2D_KEEPASPECT|V2D_KEEPZOOM); v2d->minzoom= 0.5f; v2d->maxzoom= 2.0f; v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y); - v2d->keeptot= V2D_KEEPTOT_STRICT; + v2d->keeptot= V2D_KEEPTOT_BOUNDS; v2d->tot.xmin= 0.0f; v2d->tot.xmax= winx; |