[Bf-blender-cvs] [bc0a0a1005b] master: Fix T66322 Object with particle system have expanded selection region

Clément Foucault noreply at git.blender.org
Tue Jul 2 14:06:07 CEST 2019


Commit: bc0a0a1005ba67292b9966d8e5bfe71c72c69fdc
Author: Clément Foucault
Date:   Tue Jul 2 14:04:27 2019 +0200
Branches: master
https://developer.blender.org/rBbc0a0a1005ba67292b9966d8e5bfe71c72c69fdc

Fix T66322 Object with particle system have expanded selection region

This was caused by wrong pixsize calculation during selection.

Note that this was affecting selectability of lamps too.

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

M	source/blender/editors/space_view3d/view3d_draw.c

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

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index d14a6870a6c..2e34ff7f9c1 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -169,7 +169,13 @@ void ED_view3d_update_viewmat(Depsgraph *depsgraph,
     v2[2] = rv3d->persmat[2][1];
 
     len_px = 2.0f / sqrtf(min_ff(len_squared_v3(v1), len_squared_v3(v2)));
-    len_sc = (float)MAX2(ar->winx, ar->winy);
+
+    if (rect) {
+      len_sc = (float)max_ii(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect));
+    }
+    else {
+      len_sc = (float)MAX2(ar->winx, ar->winy);
+    }
 
     rv3d->pixsize = len_px / len_sc;
   }



More information about the Bf-blender-cvs mailing list