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>2011-05-20 11:40:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-20 11:40:05 +0400
commit9f766c71b0a98801600c775dfc46faee84ddf49e (patch)
treee8d933e20df512eb836062e0f8cf9191f32c1141 /source/blender/editors/space_view3d/view3d_edit.c
parent2338765726a5aa6b8870d573d685218720864583 (diff)
use event->mval rather then subtracting ar->winrct.x / y from event->x / y
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 897114b5a3f..f79a8a55045 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2781,7 +2781,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3];
- int mx, my, mval[2];
+ int mval[2];
// short ctrl= 0; // XXX
int flip;
fp= give_cursor(scene, v3d);
@@ -2789,9 +2789,6 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
// if(obedit && ctrl) lr_click= 1;
copy_v3_v3(oldcurs, fp);
- mx= event->x - ar->winrct.xmin;
- my= event->y - ar->winrct.ymin;
-
project_int_noclip(ar, fp, mval);
flip= initgrabz(rv3d, fp[0], fp[1], fp[2]);
@@ -2808,23 +2805,20 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
short depth_used = 0;
if (U.uiflag & USER_ORBIT_ZBUF) { /* maybe this should be accessed some other way */
- int mval_depth[2];
- mval_depth[0]= mx;
- mval_depth[1]= my;
view3d_operator_needs_opengl(C);
- if (view_autodist(scene, ar, v3d, mval_depth, fp))
+ if (view_autodist(scene, ar, v3d, event->mval, fp))
depth_used= 1;
}
if(depth_used==0) {
- window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my);
+ window_to_3d_delta(ar, dvec, mval[0]-event->mval[0], mval[1]-event->mval[1]);
sub_v3_v3(fp, dvec);
}
}
else {
- dx= ((float)(mx-(ar->winx/2)))*rv3d->zfac/(ar->winx/2);
- dy= ((float)(my-(ar->winy/2)))*rv3d->zfac/(ar->winy/2);
+ dx= ((float)(event->mval[0]-(ar->winx/2)))*rv3d->zfac/(ar->winx/2);
+ dy= ((float)(event->mval[1]-(ar->winy/2)))*rv3d->zfac/(ar->winy/2);
fz= rv3d->persmat[0][3]*fp[0]+ rv3d->persmat[1][3]*fp[1]+ rv3d->persmat[2][3]*fp[2]+ rv3d->persmat[3][3];
fz= fz/rv3d->zfac;