From a3b04dffbcdaad8a39a7f17003c56d15bc1c2723 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 5 Nov 2024 11:12:22 +0100 Subject: [PATCH] Fix #129798: GPv3: Selection to Cursor/Grid missing immediate update Missing in db1443249c. Need to tag positions as changed. Also send `ND_DRAW` notifier to be sure we fully redraw (makes e.g. gizmos update accordingly as well). Pull Request: https://projects.blender.org/blender/blender/pulls/129848 --- .../editors/grease_pencil/intern/grease_pencil_edit.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc index ab463adfb41..e39d13a3f35 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc @@ -2996,9 +2996,11 @@ static int grease_pencil_snap_to_grid_exec(bContext *C, wmOperator * /*op*/) positions[point_i] = math::transform_point(world_to_layer, pos_snapped); }); + drawing_info.drawing.tag_positions_changed(); DEG_id_tag_update(&grease_pencil.id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); DEG_id_tag_update(&object.id, ID_RECALC_SYNC_TO_EVAL); WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, nullptr); + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, &grease_pencil); } return OPERATOR_FINISHED; @@ -3072,9 +3074,11 @@ static int grease_pencil_snap_to_cursor_exec(bContext *C, wmOperator *op) index_mask::masked_fill(positions, cursor_layer, selected_points); } + drawing_info.drawing.tag_positions_changed(); DEG_id_tag_update(&grease_pencil.id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); DEG_id_tag_update(&object.id, ID_RECALC_SYNC_TO_EVAL); WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, nullptr); + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, &grease_pencil); } return OPERATOR_FINISHED;