From ab86294660cdde76f0b52bbe0a7c682b5d6e65ff Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 17 Mar 2022 09:28:45 -0400 Subject: [PATCH] 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. --- Userland/Applications/FontEditor/FontEditor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index fb46d65604..71f0f6c20e 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -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()) {