Fix T93388: dropping object on grid in orthogonal view misses the floor plane

`ED_view3d_win_to_3d_on_plane` does not use the `clip_start` and
`clip_end` values of the scene, so the `do_clip` option can be misleading
especially in the orthographic view where the `clip_start` is negative.

For now, don't use the `do_clip` option in orthographic view.
This commit is contained in:
Germano Cavalcante 2021-12-05 23:29:23 -03:00
parent 3d8dea9ff9
commit 9a69c456bd
Notes: blender-bot 2023-02-14 06:21:59 +01:00
Referenced by issue #93479, 3.0 Potential candidates for corrective releases
Referenced by issue #93388, Asset browser: dropping object on grid in orthogonal view misses the floor plane
1 changed files with 2 additions and 1 deletions

View File

@ -714,6 +714,7 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
float *co_depth = snap_elem ? co : scene->cursor.location;
snap_elem &= ~data_intern->snap_elem_hidden;
if (snap_elem == 0) {
RegionView3D *rv3d = region->regiondata;
float plane[4];
if (state->plane_depth != V3D_PLACE_DEPTH_CURSOR_VIEW) {
const float *plane_normal = omat[state->plane_axis];
@ -721,7 +722,7 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
}
if ((state->plane_depth == V3D_PLACE_DEPTH_CURSOR_VIEW) ||
!ED_view3d_win_to_3d_on_plane(region, plane, mval_fl, true, co)) {
!ED_view3d_win_to_3d_on_plane(region, plane, mval_fl, rv3d->is_persp, co)) {
ED_view3d_win_to_3d(v3d, region, co_depth, mval_fl, co);
}