diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-04 16:59:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-04 16:59:24 +0400 |
commit | 5d1fdb73ce1457b39df893887951fe6571580897 (patch) | |
tree | 7a4b0206d272dc2c7610e0f0955cd71ca00cadfc | |
parent | b9076b87d28a741e09bd7da66bf9d1a1fe07c38d (diff) |
drawing in 3d camera view conversion between mouse/camera view border was broken.
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 04391d0c531..216935a2bf4 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1124,6 +1124,21 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) /* set 'initial run' flag, which is only used to denote when a new stroke is starting */ p->flags |= GP_PAINTFLAG_FIRSTRUN; + + /* when drawing in the camera view, in 2D space, set the subrect */ + if (!(p->gpd->flag & GP_DATA_VIEWALIGN)) { + if (p->sa->spacetype == SPACE_VIEW3D) { + View3D *v3d= p->sa->spacedata.first; + RegionView3D *rv3d= p->ar->regiondata; + + /* for camera view set the subrect */ + if (rv3d->persp == RV3D_CAMOB) { + view3d_calc_camera_border(p->scene, p->ar, NULL, v3d, &p->subrect_data, -1); /* negative shift */ + p->subrect= &p->subrect_data; + } + } + } + /* check if points will need to be made in view-aligned space */ if (p->gpd->flag & GP_DATA_VIEWALIGN) { switch (p->sa->spacetype) { |