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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-04 19:30:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-04 19:30:28 +0300
commiteaca7fa8b573c08fb724082a923775ac2004651e (patch)
treea7b2756a12482bb3834728cfd0baa418ab92ebee /source
parenta6bbdae805efea40982b2cf752a7acf1ef0315c7 (diff)
when autodepth is enabled use the z-depth for placing the cursor.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index ad061532045..8852b62c3b9 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2306,9 +2306,19 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
initgrabz(rv3d, fp[0], fp[1], fp[2]);
if(mval[0]!=IS_CLIPPED) {
+ short depth_used = 0;
- window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my);
- sub_v3_v3v3(fp, fp, dvec);
+ if (U.uiflag & USER_ORBIT_ZBUF) { /* maybe this should be accessed some other way */
+ short mval_depth[2] = {mx, my};
+ view3d_operator_needs_opengl(C);
+ if (view_autodist(scene, ar, v3d, mval_depth, fp))
+ depth_used= 1;
+ }
+
+ if(depth_used==0) {
+ window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my);
+ sub_v3_v3v3(fp, fp, dvec);
+ }
}
else {