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.
This commit is contained in:
Clément Foucault 2019-07-02 14:04:27 +02:00
parent ef750790d2
commit bc0a0a1005
Notes: blender-bot 2023-02-14 02:01:47 +01:00
Referenced by issue #66322, Object with particle system have wrong (expanded) selection region
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}