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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-11-29 15:43:33 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-11-29 15:43:33 +0300
commit6ae34bb0714859d9ef0b7fa2aceb16b4531df48f (patch)
treeb8304e0ed4aeefbd9af1a67be992ddb4c30a615e
parent7c703b4699e1e89686e0ba5fa4f7af7e41968b68 (diff)
Fix drawing annotations on surface
Caused by {rBaa0ac0035a0d}. Similar solution to {rBc0fdaf700a5}.
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 47af2cff0ce..fbc44ed58d8 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1666,6 +1666,7 @@ static void annotation_paint_initstroke(tGPsdata *p,
static void annotation_paint_strokeend(tGPsdata *p)
{
ToolSettings *ts = p->scene->toolsettings;
+ const bool is_eraser = (p->gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) != 0;
/* for surface sketching, need to set the right OpenGL context stuff so that
* the conversions will project the values correctly...
*/
@@ -1681,11 +1682,11 @@ static void annotation_paint_strokeend(tGPsdata *p)
(ts->annotate_v3d_align & GP_PROJECT_DEPTH_STROKE) ?
V3D_DEPTH_GPENCIL_ONLY :
V3D_DEPTH_NO_GPENCIL,
- NULL);
+ is_eraser ? NULL : &p->depths);
}
/* check if doing eraser or not */
- if ((p->gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) {
+ if (!is_eraser) {
/* transfer stroke to frame */
annotation_stroke_newfrombuffer(p);
}