mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-29 12:49:05 +00:00
FontEditor: Normalize GlyphMap selection before creating UndoSelection
Fixes bogus indexing crashes when creating new restore states.
This commit is contained in:
parent
9962a744eb
commit
ae333fad98
Notes:
sideshowbarker
2024-07-17 09:39:54 +09:00
Author: https://github.com/thankyouverycool
Commit: ae333fad98
Pull-request: https://github.com/SerenityOS/serenity/pull/14490
1 changed files with 2 additions and 1 deletions
|
@ -622,7 +622,8 @@ ErrorOr<void> FontEditorWidget::initialize(String const& path, RefPtr<Gfx::Bitma
|
|||
i++;
|
||||
}
|
||||
|
||||
m_undo_selection = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) UndoSelection(m_glyph_map_widget->selection().start(), m_glyph_map_widget->selection().size(), m_glyph_map_widget->active_glyph(), *m_edited_font)));
|
||||
auto selection = m_glyph_map_widget->selection().normalized();
|
||||
m_undo_selection = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) UndoSelection(selection.start(), selection.size(), m_glyph_map_widget->active_glyph(), *m_edited_font)));
|
||||
m_undo_stack->clear();
|
||||
|
||||
update_statusbar();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue