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:
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 04391d0c531..5763fcde705 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1124,21 +1124,29 @@ 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) {
case SPACE_VIEW3D:
{
- View3D *v3d= p->sa->spacedata.first;
RegionView3D *rv3d= p->ar->regiondata;
float rvec[3];
- /* 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;
- }
-
/* get reference point for 3d space placement */
gp_get_3d_reference(p, rvec);
initgrabz(rv3d, rvec[0], rvec[1], rvec[2]);