GPv3: Set dash segment active

When new dash segment is added in empty list, it is not set as active.
This is because active_index value becomes greater than segment_num.

Pull Request: https://projects.blender.org/blender/blender/pulls/119318
This commit is contained in:
Pratik Borhade
2024-03-11 12:30:38 +01:00
committed by Pratik Borhade
parent a53e8d6d24
commit 51bcaad457

View File

@@ -3795,7 +3795,7 @@ static int dash_modifier_segment_add_exec(bContext *C, wmOperator *op)
MEM_SAFE_FREE(dmd->segments_array);
dmd->segments_array = new_segments;
dmd->segments_num++;
dmd->segment_active_index++;
dmd->segment_active_index = new_active_index;
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_SYNC_TO_EVAL);
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);