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:
authorSergey Sharybin <sergey@blender.org>2021-01-19 16:28:44 +0300
committerSergey Sharybin <sergey@blender.org>2021-01-26 18:23:09 +0300
commit66f8835f9c03e7736297b5995a68e1455ed14e2a (patch)
treed44f2a93d14c55944a5ae55282a1527d7db90664 /source/blender/editors/space_clip/clip_ops.c
parent3d3b6d94e6e646828bd03c5656673a5d00a806aa (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/clip_ops.c')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index cd4a1ffb526..cb84ea6571c 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -1840,8 +1840,16 @@ void CLIP_OT_cursor_set(wmOperatorType *ot)
static int lock_selection_togglee_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceClip *space_clip = CTX_wm_space_clip(C);
+
+ ClipViewLockState lock_state;
+ ED_clip_view_lock_state_store(C, &lock_state);
+
space_clip->flag ^= SC_LOCK_SELECTION;
+
+ ED_clip_view_lock_state_restore_no_jump(C, &lock_state);
+
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, NULL);
+
return OPERATOR_FINISHED;
}