diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-01-19 16:28:44 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-01-26 18:23:09 +0300 |
commit | 66f8835f9c03e7736297b5995a68e1455ed14e2a (patch) | |
tree | d44f2a93d14c55944a5ae55282a1527d7db90664 /source/blender/editors/space_clip/tracking_ops.c | |
parent | 3d3b6d94e6e646828bd03c5656673a5d00a806aa (diff) |
Fix T84850: "Lock to Selection" causes unwanted jumps
Adding new tracks, mask points, mask primitives, changing selection was
causing an unwanted jumps in the view.
This change makes it so those operations are preserving view offset.
Differential Revision: https://developer.blender.org/D10146
Diffstat (limited to 'source/blender/editors/space_clip/tracking_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 10574063ebd..0f4fc2a2160 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -88,17 +88,16 @@ static int add_marker_exec(bContext *C, wmOperator *op) MovieClip *clip = ED_space_clip_get_clip(sc); float pos[2]; + ClipViewLockState lock_state; + ED_clip_view_lock_state_store(C, &lock_state); + RNA_float_get_array(op->ptr, "location", pos); if (!add_marker(C, pos[0], pos[1])) { return OPERATOR_CANCELLED; } - /* Reset offset from locked position, so frame jumping wouldn't be so - * confusing. - */ - sc->xlockof = 0; - sc->ylockof = 0; + ED_clip_view_lock_state_restore_no_jump(C, &lock_state); WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); |