Fixed more RichTextBox issues, fixed segfault from zooming in/out too fast, fixed segfault from undoing an edit

This commit is contained in:
Yousef Khadadeh 2025-10-25 17:31:55 +03:00
parent 4db5838a64
commit 011f8ba0b4
12 changed files with 113 additions and 88 deletions

View file

@ -15,8 +15,13 @@ class TextBoxEditTool : public DrawingProgramEditToolBase {
virtual bool edit_update(const std::shared_ptr<DrawComponent>& a) override;
virtual bool edit_gui(const std::shared_ptr<DrawComponent>& a) override;
private:
void edit_text(std::function<void()> toRun, const std::shared_ptr<DrawTextBox>& textBox);
void update_textbox_network(const std::shared_ptr<DrawTextBox>& textBox);
struct TextBoxEditToolAllData {
DrawTextBox::Data textboxData;
RichTextBox::RichTextData richText;
bool operator==(const TextBoxEditToolAllData& o) const = default;
bool operator!=(const TextBoxEditToolAllData& o) const = default;
};
TextBoxEditToolAllData get_all_data(const std::shared_ptr<DrawTextBox>& a);
std::optional<DrawTextBox::Data> oldData;
TextBoxEditToolAllData oldData;
};