[Bf-blender-cvs] [31c34ac] master: GPencil: Move polygon to back only if something was drawn
Antonioya
noreply at git.blender.org
Mon Aug 8 11:28:06 CEST 2016
Commit: 31c34acff0b91444100095d9c2980273a4abd437
Author: Antonioya
Date: Mon Aug 8 11:21:44 2016 +0200
Branches: master
https://developer.blender.org/rB31c34acff0b91444100095d9c2980273a4abd437
GPencil: Move polygon to back only if something was drawn
If the user enable polygon draw and press ESC before drawing something,
the last stroke must not be moved back.
===================================================================
M source/blender/editors/gpencil/gpencil_paint.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 4e521b5..3afdd57 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2367,7 +2367,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* printf("\t\tGP - end of paint op + end of stroke\n"); */
/* if drawing polygon and enable on back, must move stroke */
if ((p->scene->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) && (p->paintmode == GP_PAINTMODE_DRAW_POLY)) {
- gpencil_move_polygon_stroke_to_back(C);
+ if (p->flags & GP_PAINTFLAG_STROKEADDED) {
+ gpencil_move_polygon_stroke_to_back(C);
+ }
}
p->status = GP_STATUS_DONE;
estate = OPERATOR_FINISHED;
@@ -2427,7 +2429,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* printf("\t\tGP - end of stroke + op\n"); */
/* if drawing polygon and enable on back, must move stroke */
if ((p->scene->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) && (p->paintmode == GP_PAINTMODE_DRAW_POLY)) {
- gpencil_move_polygon_stroke_to_back(C);
+ if (p->flags & GP_PAINTFLAG_STROKEADDED) {
+ gpencil_move_polygon_stroke_to_back(C);
+ }
}
p->status = GP_STATUS_DONE;
estate = OPERATOR_FINISHED;
@@ -2511,7 +2515,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
*/
/* if drawing polygon and enable on back, must move stroke */
if ((p->scene->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) && (p->paintmode == GP_PAINTMODE_DRAW_POLY)) {
- gpencil_move_polygon_stroke_to_back(C);
+ if (p->flags & GP_PAINTFLAG_STROKEADDED) {
+ gpencil_move_polygon_stroke_to_back(C);
+ }
}
p->status = GP_STATUS_DONE;
estate = OPERATOR_FINISHED;
More information about the Bf-blender-cvs
mailing list