diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-07-02 15:04:27 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-07-02 15:06:03 +0300 |
commit | bc0a0a1005ba67292b9966d8e5bfe71c72c69fdc (patch) | |
tree | e4d4be5bd9719ddc866a78bddb9c97162d26564c /source/blender/editors | |
parent | ef750790d2613718b93d8c54007adf7eaf1372d1 (diff) |
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.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |