diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-02 13:59:14 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-02 14:29:40 +0300 |
commit | 721335553ccb5ce4f7a374b958b7d65befa319df (patch) | |
tree | 90dbe2067fe3a9211d47aebb770635e500802b49 /source/blender/editors/space_view3d/view3d_placement.c | |
parent | c2e8e68b6517b91eb14270707d7182c1727861c4 (diff) |
Add Object Tool: use the drag-start location for initial placement
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_placement.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_placement.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_placement.c b/source/blender/editors/space_view3d/view3d_placement.c index 06b848571d8..98fb914cda9 100644 --- a/source/blender/editors/space_view3d/view3d_placement.c +++ b/source/blender/editors/space_view3d/view3d_placement.c @@ -727,6 +727,17 @@ static void view3d_interactive_add_begin(bContext *C, wmOperator *op, const wmEv V3DSnapCursorState *snap_state_new = ED_view3d_cursor_snap_active(); if (snap_state_new) { ipd->snap_state = snap_state = snap_state_new; + + /* For drag events, update the location since it will be set from the drag-start. + * This is needed as cursor-drawing doesn't deal with drag events and will use + * the current cursor location instead of the drag-start. */ + if (event->val == KM_CLICK_DRAG) { + /* Set this flag so snapping always updated. */ + int flag_orig = snap_state_new->flag; + snap_state_new->flag |= V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE; + ED_view3d_cursor_snap_data_get(snap_state_new, C, event->mval[0], event->mval[1]); + snap_state_new->flag = flag_orig; + } } snap_state->draw_point = true; |