Commit: 7e3b1e2c8f9f5d95692d37707506d790c5b503f7
Author: Campbell Barton
Date: Wed Jan 19 13:20:35 2022 +1100
Branches: master
https://developer.blender.org/rB7e3b1e2c8f9f5d95692d37707506d790c5b503f7
Fix flipped order of items in the "Undo History" menu
Error in 0e1bb232e68ce71f4c3dd331ed6331665238a065.
===================================================================
M source/blender/editors/space_topbar/space_topbar.c
===================================================================
diff --git a/source/blender/editors/space_topbar/space_topbar.c
b/source/blender/editors/space_topbar/space_topbar.c
index 7f0f30624cb..82a0de9b845 100644
--- a/source/blender/editors/space_topbar/space_topbar.c
+++ b/source/blender/editors/space_topbar/space_topbar.c
@@ -243,8 +243,11 @@ static void undo_history_draw_menu(const bContext *C, Menu
*menu)
if (wm->undo_stack == NULL) {
return;
}
+
int undo_step_count = 0;
- for (UndoStep *us = wm->undo_stack->steps.first; us; us = us->next) {
+ int undo_step_count_all = 0;
+ for (UndoStep *us = wm->undo_stack->steps.last; us; us = us->prev) {
+ undo_step_count_all += 1;
if (us->skip) {
continue;
}
@@ -255,10 +258,12 @@ static void undo_history_draw_menu(const bContext *C,
Menu *menu)
uiLayout *column = NULL;
const int col_size = 20 + (undo_step_count / 12);
- int i = 0;
undo_step_count = 0;
- for (UndoStep *us = wm->undo_stack->steps.first; us; us = us->next, i++) {
+
+ /* Reverse the order so the most recent state is first in the menu. */
+ int i = undo_step_count_all - 1;
+ for (UndoStep *us = wm->undo_stack->steps.last; us; us = us->prev, i--) {
if (us->skip) {
continue;
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs