[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33110] trunk/blender/source/blender/ editors: bugfix [#24509] UV/Image Editor: selected elements move not as specified

Campbell Barton ideasman42 at gmail.com
Tue Nov 16 18:37:27 CET 2010


Revision: 33110
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33110
Author:   campbellbarton
Date:     2010-11-16 18:37:26 +0100 (Tue, 16 Nov 2010)

Log Message:
-----------
bugfix [#24509] UV/Image Editor: selected elements move not as specified

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/space_image.c
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform_constraints.c

Modified: trunk/blender/source/blender/editors/space_image/space_image.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/space_image.c	2010-11-16 17:10:39 UTC (rev 33109)
+++ trunk/blender/source/blender/editors/space_image/space_image.c	2010-11-16 17:37:26 UTC (rev 33110)
@@ -225,9 +225,18 @@
 	
 	ED_space_image_aspect(sima, aspx, aspy);
 	ED_space_image_size(sima, &w, &h);
+
+	*aspx *= (float)w;
+	*aspy *= (float)h;
 	
-	*aspx *= (float)w/256.0f;
-	*aspy *= (float)h/256.0f;
+	if(*aspx < *aspy) {
+		*aspy= *aspy / *aspx;
+		*aspx= 1.0f;
+	}
+	else {
+		*aspx= *aspx / *aspy;
+		*aspy= 1.0f;		
+	}
 }
 
 void ED_image_uv_aspect(Image *ima, float *aspx, float *aspy)

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2010-11-16 17:10:39 UTC (rev 33109)
+++ trunk/blender/source/blender/editors/transform/transform.c	2010-11-16 17:37:26 UTC (rev 33110)
@@ -3426,6 +3426,9 @@
 	if (t->con.mode & CON_APPLY) {
 		float pvec[3] = {0.0f, 0.0f, 0.0f};
 		float tvec[3];
+		if (hasNumInput(&t->num)) {
+			removeAspectRatio(t, t->values);
+		}
 		applySnapping(t, t->values);
 		t->con.applyVec(t, NULL, t->values, tvec, pvec);
 		VECCOPY(t->values, tvec);
@@ -3435,11 +3438,9 @@
 		applyNDofInput(&t->ndof, t->values);
 		snapGrid(t, t->values);
 		applyNumInput(&t->num, t->values);
-		if (hasNumInput(&t->num))
-		{
+		if (hasNumInput(&t->num)) {
 			removeAspectRatio(t, t->values);
 		}
-
 		applySnapping(t, t->values);
 		headerTranslation(t, t->values, str);
 	}

Modified: trunk/blender/source/blender/editors/transform/transform_constraints.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_constraints.c	2010-11-16 17:10:39 UTC (rev 33109)
+++ trunk/blender/source/blender/editors/transform/transform_constraints.c	2010-11-16 17:37:26 UTC (rev 33110)
@@ -154,6 +154,7 @@
 
 	if (hasNumInput(&t->num)) {
 		applyNumInput(&t->num, vec);
+		removeAspectRatio(t, vec);
 		constraintNumInput(t, vec);
 	}
 





More information about the Bf-blender-cvs mailing list