Prevent undo and redo at points when they might break the program
This commit is contained in:
parent
f606fc6fc1
commit
2de5c90006
21 changed files with 79 additions and 2 deletions
|
|
@ -261,6 +261,10 @@ void TextBoxTool::tool_update() {
|
|||
}
|
||||
}
|
||||
|
||||
bool TextBoxTool::prevent_undo_or_redo() {
|
||||
return controls.intermediateItem != nullptr;
|
||||
}
|
||||
|
||||
// Passing a function in, just in case we have to do something before editing the text
|
||||
void TextBoxTool::edit_text(std::function<void()> toRun, const std::shared_ptr<DrawTextBox>& textBox) {
|
||||
toRun();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue