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
This commit is contained in:
Antonio Vazquez 2020-07-29 11:19:35 +02:00
parent 4cad74e589
commit 659db0592d
Notes: blender-bot 2023-02-14 08:38:11 +01:00
Referenced by issue #79313, GPencil: Select Last unexpectedly selects the oldest point (instead of the newest) with strokes extruded from a single Gpencil point
1 changed files with 7 additions and 0 deletions

View File

@ -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);