Zoom to mouse position didn't work in MCE when locked to a selection
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user