diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-20 17:50:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-20 17:50:41 +0400 |
commit | 363bfdc46a05a5225bd4abc76b14ba2002f414af (patch) | |
tree | 5ffc73ffa68976711eebfc3770542a9df9287cd8 /source/blender/editors/gpencil | |
parent | a8ef6ffd170f559a50791556160fc3d7ec6a54d8 (diff) |
use consistant arguments to ED_view3d_win_* funcs, a single float vector rather then 2 floats.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 19 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 6 |
2 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 74e9799e668..83dec47bf8b 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -377,31 +377,30 @@ static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoi } else { float *fp= give_cursor(scene, v3d); - float mx, my; + float mvalf[2]; /* get screen coordinate */ if (gps->flag & GP_STROKE_2DSPACE) { - int mxi, myi; + int mvali[2]; View2D *v2d= &ar->v2d; - UI_view2d_view_to_region(v2d, pt->x, pt->y, &mxi, &myi); - mx= mxi; - my= myi; + UI_view2d_view_to_region(v2d, pt->x, pt->y, mvali, mvali+1); + VECCOPY2D(mvalf, mvali); } else { if(subrect) { - mx= (((float)pt->x/100.0f) * (subrect->xmax - subrect->xmin)) + subrect->xmin; - my= (((float)pt->y/100.0f) * (subrect->ymax - subrect->ymin)) + subrect->ymin; + mvalf[0]= (((float)pt->x/100.0f) * (subrect->xmax - subrect->xmin)) + subrect->xmin; + mvalf[1]= (((float)pt->y/100.0f) * (subrect->ymax - subrect->ymin)) + subrect->ymin; } else { - mx= (float)pt->x / 100.0f * ar->winx; - my= (float)pt->y / 100.0f * ar->winy; + mvalf[0]= (float)pt->x / 100.0f * ar->winx; + mvalf[1]= (float)pt->y / 100.0f * ar->winy; } } /* convert screen coordinate to 3d coordinates * - method taken from editview.c - mouse_cursor() */ - ED_view3d_win_to_3d(ar, fp, mx, my, p3d); + ED_view3d_win_to_3d(ar, fp, mvalf, p3d); } } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index f84e770b8f2..de989a1a292 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -253,6 +253,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, int mval[2], float out[3], flo else { const int mx=mval[0], my=mval[1]; float rvec[3], dvec[3]; + float mval_f[2]; /* Current method just converts each point in screen-coordinates to * 3D-coordinates using the 3D-cursor as reference. In general, this @@ -267,7 +268,10 @@ static void gp_stroke_convertcoords (tGPsdata *p, int mval[2], float out[3], flo /* method taken from editview.c - mouse_cursor() */ project_int_noclip(p->ar, rvec, mval); - ED_view3d_win_to_delta(p->ar, mval[0]-mx, mval[1]-my, dvec); + + mval_f[0]= mval[0] - mx; + mval_f[0]= mval[1] - my; + ED_view3d_win_to_delta(p->ar, mval_f, dvec); sub_v3_v3v3(out, rvec, dvec); } } |