Skip to content

Commit 35fca09

Browse files
committed
Allow users of the undo module to follow the command pattern more closely if needed
1 parent 010afa2 commit 35fca09

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Framework/C/Modules/Undo/Undo.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
extern "C"
66
{
77
#endif
8-
void UImGui_StateTracker_push(UImGui_CTransaction transaction)
8+
void UImGui_StateTracker_push(UImGui_CTransaction transaction, bool bRedoIsInit)
99
{
1010
UImGui::StateTracker::push({
1111
.undofunc = [&](UImGui::TransactionPayload& payload) -> void
@@ -17,7 +17,7 @@ void UImGui_StateTracker_push(UImGui_CTransaction transaction)
1717
transaction.redoFunc(&payload);
1818
},
1919
.payload = transaction.payload
20-
});
20+
}, bRedoIsInit);
2121
}
2222

2323
void UImGui_StateTracker_undo()

Framework/C/Modules/Undo/Undo.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ extern "C"
2222
} UImGui_CTransaction;
2323

2424
// UntitledImGuiFramework Event Safety - Post-begin
25-
UIMGUI_PUBLIC_API void UImGui_StateTracker_push(UImGui_CTransaction transaction);
25+
// bRedoIsInit defaults to false in the C++ API
26+
UIMGUI_PUBLIC_API void UImGui_StateTracker_push(UImGui_CTransaction transaction, bool bRedoIsInit);
2627
// UntitledImGuiFramework Event Safety - Post-begin
2728
UIMGUI_PUBLIC_API void UImGui_StateTracker_undo();
2829
// UntitledImGuiFramework Event Safety - Post-begin

0 commit comments

Comments
 (0)