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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-04-29 12:56:54 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-04-30 12:34:22 +0300
commitaa6a0409ebaf5bb9aa5546713be5586c2cfb7884 (patch)
treedca9faac26ba90777afaf8e65b68c18750795743 /source/blender/editors/gpencil/gpencil_select.c
parent9586c23d751ddacc638eab82024decbeac0b18c7 (diff)
Select: proper handling of 'deselect on nothing' for GPencil edit mode.
Was unconditionnaly behaving that way, now use proper common setting to control whether we should deselect everything when clicking on an empty area. Part of T57918.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_select.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index b8540357cf8..ba806022d3e 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1298,6 +1298,7 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
bool deselect = RNA_boolean_get(op->ptr, "deselect");
bool toggle = RNA_boolean_get(op->ptr, "toggle");
bool whole = RNA_boolean_get(op->ptr, "entire_strokes");
+ const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
int mval[2] = {0};
@@ -1360,15 +1361,18 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
/* Abort if nothing hit... */
if (ELEM(NULL, hit_stroke, hit_point)) {
+ if (deselect_all) {
+ /* since left mouse select change, deselect all if click outside any hit */
+ deselect_all_selected(C);
- /* since left mouse select change, deselect all if click outside any hit */
- deselect_all_selected(C);
+ /* copy on write tag is needed, or else no refresh happens */
+ DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY);
+ DEG_id_tag_update(&gpd->id, ID_RECALC_COPY_ON_WRITE);
+ WM_event_add_notifier(C, NC_GPENCIL | NA_SELECTED, NULL);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
- /* copy on write tag is needed, or else no refresh happens */
- DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY);
- DEG_id_tag_update(&gpd->id, ID_RECALC_COPY_ON_WRITE);
- WM_event_add_notifier(C, NC_GPENCIL | NA_SELECTED, NULL);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
+ return OPERATOR_FINISHED;
+ }
return OPERATOR_CANCELLED;
}