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>2008-03-30 05:47:06 +0400
committerMartin Poirier <theeth@yahoo.com>2008-03-30 05:47:06 +0400
commit2f1420301d2b750c8bdd8d686398f90545dd22b5 (patch)
tree85abe12c397453354783dfe187392bbafba226c1 /source/blender/src/view.c
parent68f1f2b08dbadbb20f86c7ed7d62ab731c57515d (diff)
[#7289] Orbit around selected in edit mode goes crazy with no verts selected
[#8784] orbiting around selection bug + a few kind of a must features (partial fix) As suggested by Ton, keep last center and use that when nothing selected. I don't really like it though as it wouldn't work ok when changing scene or when using a different 3D view and is somewhat non trivial to explain (it's not the last selection, it's the last used orbiting center).
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r--source/blender/src/view.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index 7d51275dc0c..c8833b1cff3 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -722,6 +722,7 @@ void viewmoveNDOFfly(int mode)
void viewmove(int mode)
{
+ static float lastofs[3] = {0,0,0};
Object *ob = OBACT;
float firstvec[3], newvec[3], dvec[3];
float reverse, oldquat[4], q1[4], si, phi, dist0;
@@ -783,13 +784,15 @@ void viewmove(int mode)
obofs[1]= -obofs[1];
obofs[2]= -obofs[2];
}
- else if (ob && (U.uiflag & USER_ORBIT_SELECTION)) {
+ else if (U.uiflag & USER_ORBIT_SELECTION) {
use_sel = 1;
VECCOPY(ofs, G.vd->ofs);
- /* If there's no selection, obofs is unmodified, so <0,0,0> */
- calculateTransformCenter(V3D_CENTROID, obofs);
+ /* If there's no selection, lastofs is unmodified and last value since static */
+ calculateTransformCenter(V3D_CENTROID, lastofs);
+
+ VECCOPY(obofs, lastofs);
VecMulf(obofs, -1.0f);
}
else