[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50943] trunk/blender/source/blender/ editors/interface/view2d_ops.c: Made View2D drag zoom behave in the same way as zoom in 3d viewport
Sergey Sharybin
sergey.vfx at gmail.com
Fri Sep 28 14:01:22 CEST 2012
Revision: 50943
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50943
Author: nazgul
Date: 2012-09-28 12:01:21 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/view2d_ops.c
Modified: trunk/blender/source/blender/editors/interface/view2d_ops.c
===================================================================
--- trunk/blender/source/blender/editors/interface/view2d_ops.c 2012-09-28 11:28:23 UTC (rev 50942)
+++ trunk/blender/source/blender/editors/interface/view2d_ops.c 2012-09-28 12:01:21 UTC (rev 50943)
@@ -849,12 +849,12 @@
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 @@
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 @@
}
/* 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;
More information about the Bf-blender-cvs
mailing list