diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2019-07-31 19:16:37 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2019-07-31 19:16:37 +0300 |
commit | bcda8cc89b88c999ff64edcc19973d6289bcbf2a (patch) | |
tree | d8dc110ba901bdbed8289f09682c32ce85e6888a /source/blender/editors/space_clip | |
parent | 0516d49d0ca59044c36986c360eaa485020da044 (diff) |
Fix T65837: "Zoom Axis" is not working on the node editor
We would not take into account the user "Zoom Axis" setting in certain
2D space viewports. In addition to this, the "Scale Zoom" didn't work
consistently in these spaces either.
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D5132
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index e1af9728685..5f04d0863a7 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -626,36 +626,35 @@ static void view_zoom_apply( bContext *C, ViewZoomData *vpd, wmOperator *op, const wmEvent *event, const bool zoom_to_pos) { float factor; + float delta; - if (U.viewzoom == USER_ZOOM_CONT) { - SpaceClip *sclip = CTX_wm_space_clip(C); - double time = PIL_check_seconds_timer(); - float time_step = (float)(time - vpd->timer_lastdraw); - float fac; - float zfac; - + if (U.viewzoom != USER_ZOOM_SCALE) { if (U.uiflag & USER_ZOOM_HORIZ) { - fac = (float)(event->x - vpd->x); + delta = (float)(event->x - vpd->x); } else { - fac = (float)(event->y - vpd->y); + delta = (float)(event->y - vpd->y); } + } + else { + delta = event->x - vpd->x + event->y - vpd->y; + } - if (U.uiflag & USER_ZOOM_INVERT) { - fac = -fac; - } + if (U.uiflag & USER_ZOOM_INVERT) { + delta = -delta; + } - zfac = 1.0f + ((fac / 20.0f) * time_step); + if (U.viewzoom == USER_ZOOM_CONT) { + SpaceClip *sclip = CTX_wm_space_clip(C); + double time = PIL_check_seconds_timer(); + float time_step = (float)(time - vpd->timer_lastdraw); + float zfac; + + zfac = 1.0f + ((delta / 20.0f) * time_step); vpd->timer_lastdraw = time; factor = (sclip->zoom * zfac) / vpd->zoom; } else { - float delta = event->x - vpd->x + event->y - vpd->y; - - if (U.uiflag & USER_ZOOM_INVERT) { - delta *= -1; - } - factor = 1.0f + delta / 300.0f; } |