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:
authorCampbell Barton <ideasman42@gmail.com>2010-08-06 07:52:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-06 07:52:13 +0400
commit99c64e05a6a7cdd8b2e5bf88706165ebdb5101d1 (patch)
tree23bfe326c0957b1285176c7051742211457c2882 /source/blender/editors/space_view3d/view3d_view.c
parent267a7b76e837d9de5b3a280fd731f9c678ead59e (diff)
bugfix/functionality fix [#21752] 3D cursor vanished and does not come back
Setting the 3d cursor in perspective mode would keep the cursor behind the viewport, now check if the cursor is begind the viewport and use the orbit location to set the cursor depth rather then the existing plane.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index b681f15433c..b2bc071122f 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -588,11 +588,13 @@ void viewvector(RegionView3D *rv3d, float coord[3], float vec[3])
normalize_v3(vec);
}
-void initgrabz(RegionView3D *rv3d, float x, float y, float z)
+int initgrabz(RegionView3D *rv3d, float x, float y, float z)
{
- if(rv3d==NULL) return;
+ int flip= FALSE;
+ if(rv3d==NULL) return flip;
rv3d->zfac= rv3d->persmat[0][3]*x+ rv3d->persmat[1][3]*y+ rv3d->persmat[2][3]*z+ rv3d->persmat[3][3];
-
+ if (rv3d->zfac < 0.0f)
+ flip= TRUE;
/* if x,y,z is exactly the viewport offset, zfac is 0 and we don't want that
* (accounting for near zero values)
* */
@@ -605,6 +607,8 @@ void initgrabz(RegionView3D *rv3d, float x, float y, float z)
// -- Aligorith, 2009Aug31
//if (rv3d->zfac < 0.0f) rv3d->zfac = 1.0f;
if (rv3d->zfac < 0.0f) rv3d->zfac= -rv3d->zfac;
+
+ return flip;
}
/* always call initgrabz */