Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-09-18 15:31:44 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-09-18 15:31:44 +0300
commitb6ff37ee67bd0d364c737090c3f0d9dee9dda8d1 (patch)
tree01d14e78b417bada752121812d06fb50213f4334 /source/blender/editors/space_clip
parenteafec6d4f72b05c389576358b9e1d0ebd87cf174 (diff)
parent06fd94140cb0546e99aedcde4175ca1862652885 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c10
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;