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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-09-28 16:01:21 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-09-28 16:01:21 +0400
commitcd560a1e6acd5ec9353a7f75ffd2310352435c88 (patch)
tree6d43d407ed247f5ca66875975627e163ece0d250 /source/blender/editors/interface/view2d_ops.c
parentde1f84783be75261d5a1e17859f3c902d0b5ba1b (diff)
Made View2D drag zoom behave in the same way as zoom in 3d viewport
Initially issue was caused by opposite MMB-Drag zoom direction in nodes editor. Made it so MMB-Drag in negative axis direction (down for Y axis and left for X axis) would zoom in, moving in opposite direction will zoom out. This could kind of break muscule memory, but after discussion with Campbell decided it's not so big a problem -- seems users weren't related on direction of zoom in and just waved mouse around until zoom is correct. And now muscule memory should even be a bit better -- drag zoom is unified between different areas.
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r--source/blender/editors/interface/view2d_ops.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 30adf79b362..5ac20829480 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -849,12 +849,12 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
float mval_faci = 1.0f - mval_fac;
float ofs = (mval_fac * dx) - (mval_faci * dx);
- v2d->cur.xmin += ofs + dx;
- v2d->cur.xmax += ofs - dx;
+ v2d->cur.xmin += ofs - dx;
+ v2d->cur.xmax += ofs + dx;
}
else {
- v2d->cur.xmin += dx;
- v2d->cur.xmax -= dx;
+ v2d->cur.xmin -= dx;
+ v2d->cur.xmax += dx;
}
}
}
@@ -868,12 +868,12 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
float mval_faci = 1.0f - mval_fac;
float ofs = (mval_fac * dy) - (mval_faci * dy);
- v2d->cur.ymin += ofs + dy;
- v2d->cur.ymax += ofs - dy;
+ v2d->cur.ymin += ofs - dy;
+ v2d->cur.ymax += ofs + dy;
}
else {
- v2d->cur.ymin += dy;
- v2d->cur.ymax -= dy;
+ v2d->cur.ymin -= dy;
+ v2d->cur.ymax += dy;
}
}
}
@@ -1044,8 +1044,14 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
}
/* set transform amount, and add current deltas to stored total delta (for redo) */
- RNA_float_set(op->ptr, "deltax", dx);
- RNA_float_set(op->ptr, "deltay", dy);
+ if (U.uiflag & USER_ZOOM_INVERT) {
+ RNA_float_set(op->ptr, "deltax", -dx);
+ RNA_float_set(op->ptr, "deltay", -dy);
+ }
+ else {
+ RNA_float_set(op->ptr, "deltax", dx);
+ RNA_float_set(op->ptr, "deltay", dy);
+ }
vzd->dx += dx;
vzd->dy += dy;