[Bf-blender-cvs] [a1b34c0] master: Fix T46510: VSE View-all crops out image

Campbell Barton noreply at git.blender.org
Fri Oct 16 17:09:24 CEST 2015


Commit: a1b34c0d289184b201912f715e730f54943dd4de
Author: Campbell Barton
Date:   Sat Oct 17 02:01:41 2015 +1100
Branches: master
https://developer.blender.org/rBa1b34c0d289184b201912f715e730f54943dd4de

Fix T46510: VSE View-all crops out image

===================================================================

M	source/blender/editors/interface/view2d.c

===================================================================

diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index b366cf1..9976f42 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 {




More information about the Bf-blender-cvs mailing list