1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

FontEditor: Reset unicode block view on undo/redo actions

If the previous active glyph is outside the currently selected
block range, reset GlyphMap to show all glyphs. This is less
disorienting when undoing changes outside the visible range.
This commit is contained in:
thankyouverycool 2022-03-17 09:28:45 -04:00 committed by Andreas Kling
parent a3956da6dc
commit ab86294660

View file

@ -677,6 +677,8 @@ void FontEditorWidget::undo()
m_undo_stack->undo();
auto glyph = m_undo_selection->previous_active_glyph();
auto glyph_width = edited_font().raw_glyph_width(glyph);
if (glyph < m_range.first || glyph > m_range.last)
m_search_textbox->set_text("");
m_glyph_map_widget->set_active_glyph(glyph);
m_glyph_map_widget->scroll_to_glyph(glyph);
if (m_edited_font->is_fixed_width()) {
@ -697,6 +699,8 @@ void FontEditorWidget::redo()
m_undo_stack->redo();
auto glyph = m_undo_selection->previous_active_glyph();
auto glyph_width = edited_font().raw_glyph_width(glyph);
if (glyph < m_range.first || glyph > m_range.last)
m_search_textbox->set_text("");
m_glyph_map_widget->set_active_glyph(glyph);
m_glyph_map_widget->scroll_to_glyph(glyph);
if (m_edited_font->is_fixed_width()) {