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:
parent
580c603df0
commit
256c1b82f6
Notes:
blender-bot
2023-02-14 04:20:36 +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
|
@ -716,6 +716,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];
|
||||
|
@ -723,7 +724,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue