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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-09-18 15:30:06 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-09-18 15:31:05 +0300
commit06fd94140cb0546e99aedcde4175ca1862652885 (patch)
tree838ebbe0566c6ecc599a7837d123dca61a91633c /source
parentd04eb330e873488d8b7cbe49da5600d6f64ea6db (diff)
Fix T56833: "zoom to cursor" in Clip editor not handling aspect ratio.
Trivial fix, just using same code as in Image editor...
Diffstat (limited to 'source')
-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 4754d45a0d1..3a66fb05d21 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -113,12 +113,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;