mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:27:35 +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
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