diff options
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 19 |
1 files changed, 9 insertions, 10 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); } } |