diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-18 15:31:44 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-18 15:31:44 +0300 |
commit | b6ff37ee67bd0d364c737090c3f0d9dee9dda8d1 (patch) | |
tree | 01d14e78b417bada752121812d06fb50213f4334 | |
parent | eafec6d4f72b05c389576358b9e1d0ebd87cf174 (diff) | |
parent | 06fd94140cb0546e99aedcde4175ca1862652885 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 26327dc9b41..af35be2c9c1 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -114,12 +114,16 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2]) } if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) { - float dx, dy; + float aspx, aspy, w, h, dx, dy; ED_space_clip_get_size(sc, &width, &height); + ED_space_clip_get_aspect(sc, &aspx, &aspy); - 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; + w = width * aspx; + h = height * aspy; + + 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) { sc->xlockof += dx; |