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:
authorAntonio Vazquez <blendergit@gmail.com>2020-07-29 12:19:35 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-07-29 12:19:35 +0300
commit659db0592d22d970baab54eaadc2975ca51d1603 (patch)
tree094a57eddead8ec29ce56acdbca7bcbcd21ab8f5
parent4cad74e589f794f128c38d6211fe8ba6cef5f73e (diff)
GPencil: Consider extrude point as last
Before, when extrude a point, the extruded point is considered as the first point of the stroke, but this was not logic. Now, the extrude point is considered as last. Related to T79313
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index f8010edfcdd..7b3cb08c6d5 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -94,6 +94,8 @@
/** \name Stroke Edit Mode Management
* \{ */
+static void gpencil_flip_stroke(bGPDstroke *gps);
+
/* poll callback for all stroke editing operators */
static bool gpencil_stroke_edit_poll(bContext *C)
{
@@ -1126,6 +1128,11 @@ static void gpencil_add_move_points(bGPDframe *gpf, bGPDstroke *gps)
pt->flag |= GP_SPOINT_SELECT;
}
+ /* Flip stroke if it was only one point to consider extrude point as last point. */
+ if (gps->totpoints == 2) {
+ gpencil_flip_stroke(gps);
+ }
+
/* Calc geometry data. */
BKE_gpencil_stroke_geometry_update(gps);