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:
authorMartin Poirier <theeth@yahoo.com>2007-09-07 01:35:51 +0400
committerMartin Poirier <theeth@yahoo.com>2007-09-07 01:35:51 +0400
commit0ec6abd2d19d4569fc180aeef516a3bd444bc155 (patch)
tree2203586778cb92aba15a40280289a7b623971775 /source/blender/src
parentbd7ebb0abc675f4d5bb262dabf7622ae6072abf7 (diff)
[#7299] Orbit around selected causes panning to be reversed
The actual "bug" is much more general than simple viewmove. In fact, any time the center (for viewmove, or transform, or ...) on which initgrabz is called was behind the camera (in perspective, then), all mouse motion where reversed. What I added is a special handling case that reverts those situation to the default case (center = viewport offset). This changes the behavior for those case to something much more predictable/useable, but I doubt anyone expected it to work incorrectly, so I'd say that's alright. This covers other cases than transform and viewmove (which are the only ones I really tested), but I don't expect breakage elsewhere. If anyone disagrees with the change, feel free to offer a better solution.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/view.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index c501dbb8f73..b17dfbd2bb7 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -152,6 +152,11 @@ void initgrabz(float x, float y, float z)
* (accounting for near zero values)
* */
if (G.vd->zfac < 1.e-6f && G.vd->zfac > -1.e-6f) G.vd->zfac = 1.0f;
+
+ /* Negative zfac means x, y, z was behind the camera (in perspective).
+ * This gives flipped directions, so revert back to ok default case.
+ */
+ if (G.vd->zfac < 0.0f) G.vd->zfac = 1.0f;
}
void window_to_3d(float *vec, short mx, short my)