From a1b34c0d289184b201912f715e730f54943dd4de Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Oct 2015 02:01:41 +1100 Subject: Fix T46510: VSE View-all crops out image --- source/blender/editors/interface/view2d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index b366cf16179..9976f42a48a 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -472,7 +472,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas /* check if we should restore aspect ratio (if view size changed) */ if (v2d->keepzoom & V2D_KEEPASPECT) { bool do_x = false, do_y = false, do_cur /* , do_win */ /* UNUSED */; - float /* curRatio, */ /* UNUSED */ winRatio; + float curRatio, winRatio; /* when a window edge changes, the aspect ratio can't be used to * find which is the best new 'cur' rect. thats why it stores 'old' @@ -480,7 +480,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas if (winx != v2d->oldwinx) do_x = true; if (winy != v2d->oldwiny) do_y = true; - /* curRatio = height / width; */ /* UNUSED */ + curRatio = height / width; winRatio = winy / winx; /* both sizes change (area/region maximized) */ @@ -490,7 +490,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas if (fabsf(winx - v2d->oldwinx) > fabsf(winy - v2d->oldwiny)) do_y = false; else do_x = false; } - else if (winRatio > 1.0f) { + else if (winRatio > curRatio) { do_x = false; } else { -- cgit v1.2.3