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:
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c12
-rw-r--r--source/blender/editors/space_clip/space_clip.c6
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 4754d45a0d1..1d9669e3e97 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;
@@ -1585,7 +1589,7 @@ void CLIP_OT_cursor_set(wmOperatorType *ot)
"Cursor location in normalized clip coordinates", -10.0f, 10.0f);
}
-/********************** macroses *********************/
+/********************** macros *********************/
void ED_operatormacros_clip(void)
{
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 35aa9896d12..763bb1bcc88 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1185,6 +1185,9 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
/* data... */
movieclip_main_area_set_view2d(C, ar);
+ /* callback */
+ ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+
clip_draw_main(C, sc, ar);
/* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
@@ -1230,6 +1233,9 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
clip_draw_grease_pencil((bContext *)C, true);
}
+ /* callback */
+ ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
+
/* reset view matrix */
UI_view2d_view_restore(C);