Fix T97120: Gizmo fails to select in orthographic view

Regression in exposed by 49fc4449e7.
This commit is contained in:
Campbell Barton 2022-04-29 16:17:55 +10:00
parent 7f0163118b
commit cc8fe1a1cb
Notes: blender-bot 2023-02-14 07:39:44 +01:00
Referenced by commit 5045968f24, Revert "Gizmo: optimize intersection tests, fix selection bias"
Referenced by issue #100321, Regression: Extrude Tool XYZ Handles overlap on orthographic view and small world scale
Referenced by issue #97120, Regression: Gizmos became significantly harder to use (in orthographic view)
1 changed files with 1 additions and 1 deletions

View File

@ -649,7 +649,7 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos,
BLI_assert(buf_iter->id != -1);
wmGizmo *gz = visible_gizmos[buf_iter->id >> 8];
float co_3d[3];
co_screen[2] = int_as_float(buf_iter->depth);
co_screen[2] = (float)((double)buf_iter->depth / (double)UINT_MAX);
GPU_matrix_unproject_3fv(co_screen, rv3d->viewinv, rv3d->winmat, viewport, co_3d);
float select_bias = gz->select_bias;
if ((gz->flag & WM_GIZMO_DRAW_NO_SCALE) == 0) {