From bf721fb6798bc21206e9e8b3c0f9b81e8ac9400f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 27 Jan 2021 17:07:48 +0100 Subject: 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 --- source/blender/editors/space_clip/clip_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_clip/clip_ops.c') 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]; } -- cgit v1.2.3