diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-01-27 19:07:48 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-01-28 13:34:53 +0300 |
commit | bf721fb6798bc21206e9e8b3c0f9b81e8ac9400f (patch) | |
tree | 272ada4699a194a92bca1cef21027b2acd2225f0 /source/blender/editors/space_clip/clip_ops.c | |
parent | 3b66f40d40e4e7fd5d301f88e57c04cd0945dbf0 (diff) |
Fix panning with Lock-to-Selection and no selection in Clip Editor
Rather self-explanatory. Never worked since the initial implementation.
It is possible to preserve lock-to-selection option with no selection
nowadays (since the fix for T84850). So now the Lock-to-Selection option
is fully under user control. Surely, the panning and zooming is also
properly supported now in the described scenario.
Differential Revision: https://developer.blender.org/D10226
Diffstat (limited to 'source/blender/editors/space_clip/clip_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index cb84ea6571c..ea2dd0cb7aa 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -125,7 +125,7 @@ static void sclip_zoom_set(const bContext *C, dx = ((location[0] - 0.5f) * w - sc->xof) * (sc->zoom - oldzoom) / sc->zoom; dy = ((location[1] - 0.5f) * h - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; - if (sc->flag & SC_LOCK_SELECTION) { + if (clip_view_has_locked_selection(C)) { sc->xlockof += dx; sc->ylockof += dy; } @@ -396,7 +396,7 @@ static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event) vpd->x = event->x; vpd->y = event->y; - if (sc->flag & SC_LOCK_SELECTION) { + if (clip_view_has_locked_selection(C)) { vpd->vec = &sc->xlockof; } else { @@ -434,7 +434,7 @@ static int view_pan_exec(bContext *C, wmOperator *op) RNA_float_get_array(op->ptr, "offset", offset); - if (sc->flag & SC_LOCK_SELECTION) { + if (clip_view_has_locked_selection(C)) { sc->xlockof += offset[0]; sc->ylockof += offset[1]; } |