Zoom to mouse position didn't work in MCE when locked to a selection
This commit is contained in:
parent
a7ed1db51f
commit
765d077a1a
Notes:
blender-bot
2023-06-26 11:58:59 +02:00
Referenced by issue #39463, Segmentation fault on render Referenced by issue #39415, OSL Attribute node only works when SVM Attribute node is present Referenced by issue #39419, Crash when solving camera motion
|
@ -110,10 +110,21 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2])
|
|||
}
|
||||
|
||||
if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
|
||||
float dx, dy;
|
||||
|
||||
ED_space_clip_get_size(sc, &width, &height);
|
||||
|
||||
sc->xof += ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom;
|
||||
sc->yof += ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom;
|
||||
dx = ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom;
|
||||
dy= ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom;
|
||||
|
||||
if (sc->flag & SC_LOCK_SELECTION) {
|
||||
sc->xlockof += dx;
|
||||
sc->ylockof += dy;
|
||||
}
|
||||
else {
|
||||
sc->xof += dx;
|
||||
sc->yof += dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue