Blender Git Loki

Git Commits -> Revision 2a8122f

Revision 2a8122f by Bastien Montagne (master)
January 26, 2021, 08:44 (GMT)
ed_undo refactor: split/remove `ed_undo_step_impl`.

This function was doing too many things, with behaviors fairly different
depending on its input parameters. This was making the code fragile and
hard to follow.

Split it in three:
* `ed_undo_step_pre` does the common actions before we actually undo
data.
* `ed_undo_step_post` does the common actions after we have undone/redone
data.

Then, `ed_undo_step_direction`, `ed_undo_step_by_name` and
`ed_undo_step_by_index` do their actual specific actions, with their own
logic.

Note: Since the actual behavior of those three funtions is fairly
different (the first only undo/redo one effective step, the second is only
supposed to **undo** //before// given named step, and the third actually
undo/redo until given indexed step become active), we could also find
better names for those. right now, it sounds like they are doing the
same thing, with just different ways to specify the target step.

Note: This is part of on-going refactor work on undo system, see T83806.

Differential Revision: https://developer.blender.org/D10112

Commit Details:

Full Hash: 2a8122fb65c50999b9e89484724c27c9d15ae628
Parent Commit: 0d9f79b
Lines Changed: +125, -94

1 Modified Path:

/source/blender/editors/undo/ed_undo.c (+125, -94) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021