diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 2e26988877f..d1c5429c1a8 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -41,16 +41,11 @@ #include "BLI_math.h" #include "BLI_rand.h" -#include "BKE_action.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_object.h" -#include "BKE_global.h" #include "BKE_paint.h" #include "BKE_report.h" #include "BKE_scene.h" -#include "BKE_screen.h" -#include "BKE_utildefines.h" #include "BIF_gl.h" @@ -2396,7 +2391,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event) float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; short mx, my, mval[2]; // short ctrl= 0; // XXX - + int flip; fp= give_cursor(scene, v3d); // if(obedit && ctrl) lr_click= 1; @@ -2404,9 +2399,18 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event) mx= event->x - ar->winrct.xmin; my= event->y - ar->winrct.ymin; + project_short_noclip(ar, fp, mval); + flip= initgrabz(rv3d, fp[0], fp[1], fp[2]); + + /* reset the depth based on the view offset */ + if(flip) { + negate_v3_v3(fp, rv3d->ofs); - initgrabz(rv3d, fp[0], fp[1], fp[2]); + /* re initialize */ + project_short_noclip(ar, fp, mval); + flip= initgrabz(rv3d, fp[0], fp[1], fp[2]); + } if(mval[0]!=IS_CLIPPED) { short depth_used = 0; |