diff options
author | Antonioya <blendergit@gmail.com> | 2018-12-19 21:50:07 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-12-19 21:50:28 +0300 |
commit | 205b0d4651d866c45442acf7066eff276245efa9 (patch) | |
tree | 87911c6e3de85d039e9afa6061a777c8167f57eb /source/blender/editors/gpencil | |
parent | a8198e6fbf6bc3ef870e89988593282489c011e4 (diff) |
GP: Fix error drawing on Camera view for Surface/Stroke
This bug was introduced fixing task T59595
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 5 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 5 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 0e1a5e613b2..e4e71339560 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -820,7 +820,10 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf) const int cfra_eval = (int)DEG_get_ctime(tgpf->depsgraph); ToolSettings *ts = tgpf->scene->toolsettings; - const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && (tgpf->rv3d->persp == RV3D_CAMOB); + const char *align_flag = &ts->gpencil_v3d_align; + const bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE)); + const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && + (tgpf->rv3d->persp == RV3D_CAMOB) && (!is_depth); Brush *brush = BKE_paint_brush(&ts->gp_paint->paint); if (brush == NULL) { return; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index ce15b2ba6b0..6e79afc747e 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -848,7 +848,10 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) RegionView3D *rv3d = p->ar->regiondata; const int def_nr = obact->actdef - 1; const bool have_weight = (bool)BLI_findlink(&obact->defbase, def_nr); - const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && (rv3d->persp == RV3D_CAMOB); + const char *align_flag = &ts->gpencil_v3d_align; + const bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE)); + const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && + (rv3d->persp == RV3D_CAMOB) && (!is_depth); int i, totelem; /* since strokes are so fine, when using their depth we need a margin otherwise they might get missed */ diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index e1c3561ff76..efdcb263ec5 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -639,9 +639,10 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) bGPDstroke *gps = tgpi->gpf->strokes.first; GP_Sculpt_Settings *gset = &ts->gp_sculpt; int depth_margin = (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 4 : 0; - char *align_flag = &ts->gpencil_v3d_align; + const char *align_flag = &ts->gpencil_v3d_align; bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE)); - const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && (tgpi->rv3d->persp == RV3D_CAMOB); + const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && + (tgpi->rv3d->persp == RV3D_CAMOB) && (!is_depth); if (tgpi->type == GP_STROKE_BOX) gps->totpoints = (tgpi->tot_edges * 4 + tgpi->tot_stored_edges); |