Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-02 13:59:14 +0300
committerCampbell Barton <campbell@blender.org>2022-03-02 14:29:40 +0300
commit721335553ccb5ce4f7a374b958b7d65befa319df (patch)
tree90dbe2067fe3a9211d47aebb770635e500802b49 /source/blender/editors/space_view3d
parentc2e8e68b6517b91eb14270707d7182c1727861c4 (diff)
Add Object Tool: use the drag-start location for initial placement
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_placement.c11
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;