summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-03-17 09:28:45 -0400
committerAndreas Kling <kling@serenityos.org>2022-03-18 01:12:26 +0100
commitab86294660cdde76f0b52bbe0a7c682b5d6e65ff (patch)
tree4e15955403f5a742c8c5f896edb4b24231d0edaa
parenta3956da6dc4998bcad1befd5b7893f6f6cdac430 (diff)
downloadserenity-ab86294660cdde76f0b52bbe0a7c682b5d6e65ff.zip
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.
-rw-r--r--Userland/Applications/FontEditor/FontEditor.cpp4
1 files changed, 4 insertions, 0 deletions
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()) {