Commit: d2d0f8a0510d5c6cf901fcb0c1d914b074929fc8
Author: Phil Gosch
Date:   Wed May 25 11:16:41 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rBd2d0f8a0510d5c6cf901fcb0c1d914b074929fc8

Fix for bug in optional packing with unwrap operator

Center and scale were off if aspect ratio != 1

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

M       source/blender/editors/uvedit/uvedit_parametrizer.c

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

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c 
b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 45c0649..9b95865 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -4687,18 +4687,18 @@ void param_scale_bounds(ParamHandle *handle)
                        tot_height = fabsf(minv[1]) + fabsf(maxv[1]);
                else
                        tot_height = maxv[1] - minv[1];
-               
-               if (tot_height > tot_width)
-                       scale = 1.0f / tot_height;
+
+               if (tot_height >= tot_width)
+                       scale = phandle->aspy / tot_height;
                else
-                       scale = 1.0f / tot_width;
-               
+                       scale = phandle->aspx / tot_width;
+       
                /* Scale to fit UV area */
                p_chart_uv_scale(chart, scale);
                
                /* Move chart to center of UV Space*/
-               trans[0] = 0.5f;
-               trans[1] = 0.5f;
+               trans[0] = phandle->aspx / 2.0f;
+               trans[1] = phandle->aspy / 2.0f;
                p_chart_uv_translate(chart, trans);
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to