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:
authorSebastian Parborg <darkdefende@gmail.com>2019-07-31 19:16:37 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-07-31 19:16:37 +0300
commitbcda8cc89b88c999ff64edcc19973d6289bcbf2a (patch)
treed8dc110ba901bdbed8289f09682c32ce85e6888a /source/blender/editors/space_clip/clip_ops.c
parent0516d49d0ca59044c36986c360eaa485020da044 (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/clip_ops.c')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c37
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;
}