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:
authorAntonioya <blendergit@gmail.com>2016-08-08 12:21:44 +0300
committerAntonioya <blendergit@gmail.com>2016-08-08 12:26:28 +0300
commit31c34acff0b91444100095d9c2980273a4abd437 (patch)
tree216905af7a26408dab5024f3d8ac3a29dcb7ef49 /source/blender/editors/gpencil/gpencil_paint.c
parent5c815a6d78b9963d48d8f29793423b40518be843 (diff)
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.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 4e521b5909c..3afdd5772fc 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;