diff options
author | Bastien Montagne <bastien@blender.org> | 2021-01-14 13:34:00 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-01-14 14:02:51 +0300 |
commit | a0029a678f55798d31261070b69d10b2a7395e99 (patch) | |
tree | b33174ccffe13891e6cd9f848f52ed4b03c439f6 /source/blender/editors/undo | |
parent | 8cdd701b4590f4f0dc95eedfaff17570aa53ffa0 (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/undo')
-rw-r--r-- | source/blender/editors/undo/ed_undo.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index d15f6d33acd..d29e9779130 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -77,7 +77,7 @@ static CLG_LogRef LOG = {"ed.undo"}; enum eUndoStepDir { STEP_REDO = 1, STEP_UNDO = -1, - /** Only used when the undo name is passed to #ed_undo_step_impl. */ + /** Only used when the undo step name or index is passed to #ed_undo_step_impl. */ STEP_NONE = 0, }; @@ -207,8 +207,12 @@ static int ed_undo_step_impl( /* TODO(campbell): undo_system: use undo system */ /* grease pencil can be can be used in plenty of spaces, so check it first */ + /* FIXME: This gpencil undo effectively only supports the one step undo/redo, undo based on name + * or index is fully not implemented. + * FIXME: However, it seems to never be used in current code (`ED_gpencil_session_active` seems + * to always return false). */ if (ED_gpencil_session_active()) { - return ED_undo_gpencil_step(C, (int)step, undoname); + return ED_undo_gpencil_step(C, (int)step); } if (area && (area->spacetype == SPACE_VIEW3D)) { Object *obact = CTX_data_active_object(C); |