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 <bastien@blender.org>2021-01-14 13:34:00 +0300
committerBastien Montagne <bastien@blender.org>2021-01-14 14:02:51 +0300
commita0029a678f55798d31261070b69d10b2a7395e99 (patch)
treeb33174ccffe13891e6cd9f848f52ed4b03c439f6 /source/blender/editors/gpencil/gpencil_undo.c
parent8cdd701b4590f4f0dc95eedfaff17570aa53ffa0 (diff)
Cleanup/refactor: Remove logically broken code from GPencil undo.
`ED_undo_gpencil_step` only support valid undo step direction, passing step name here is useless and only add confusion to what works or not. Undo by step name or step index is fully not supported by GPencil undo mode currently. Note that since GPencil undo mode does not seem to ever be used anyway, this is not an urgent issue in practice, but this needs to be cleaned up at some point. See also T84703.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_undo.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index 10d15c8afbc..d9bc77c8715 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -61,28 +61,22 @@ int ED_gpencil_session_active(void)
return (BLI_listbase_is_empty(&undo_nodes) == false);
}
-int ED_undo_gpencil_step(bContext *C, int step, const char *name)
+int ED_undo_gpencil_step(bContext *C, const int step)
{
bGPdata **gpd_ptr = NULL, *new_gpd = NULL;
gpd_ptr = ED_gpencil_data_get_pointers(C, NULL);
if (step == -1) { /* undo */
- // printf("\t\tGP - undo step\n");
if (cur_node->prev) {
- if (!name || STREQ(cur_node->name, name)) {
- cur_node = cur_node->prev;
- new_gpd = cur_node->gpd;
- }
+ cur_node = cur_node->prev;
+ new_gpd = cur_node->gpd;
}
}
else if (step == 1) {
- // printf("\t\tGP - redo step\n");
if (cur_node->next) {
- if (!name || STREQ(cur_node->name, name)) {
- cur_node = cur_node->next;
- new_gpd = cur_node->gpd;
- }
+ cur_node = cur_node->next;
+ new_gpd = cur_node->gpd;
}
}