summaryrefslogtreecommitdiff
path: root/Userland/Applications/FontEditor
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-12-17 15:36:02 -0500
committerAndreas Kling <kling@serenityos.org>2022-12-20 10:22:27 +0100
commit40e94a315a8dee8eebda93ad2c94042258cf533f (patch)
treea9579f6858e66eb0ba73e98d54f84b2ac25143a5 /Userland/Applications/FontEditor
parent02212f373be0bbf4ccbb97a7266368cd208389e9 (diff)
downloadserenity-40e94a315a8dee8eebda93ad2c94042258cf533f.zip
LibGUI+FontEditor: Restore normalized selections on Undo/Redo
Selections are always normalized when saving undo commands. The restore_selection() function reverses this process so negatively sized selections (created right-to-left) continue to resize correctly with the keyboard when restored.
Diffstat (limited to 'Userland/Applications/FontEditor')
-rw-r--r--Userland/Applications/FontEditor/MainWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp
index 73a82e1eb9..048a299171 100644
--- a/Userland/Applications/FontEditor/MainWidget.cpp
+++ b/Userland/Applications/FontEditor/MainWidget.cpp
@@ -811,7 +811,7 @@ void MainWidget::undo()
deferred_invoke([this, glyph] {
auto start = m_undo_selection->restored_start();
auto size = m_undo_selection->restored_size();
- m_glyph_map_widget->set_selection(start, size, glyph);
+ m_glyph_map_widget->restore_selection(start, size, glyph);
m_glyph_map_widget->scroll_to_glyph(glyph);
m_glyph_map_widget->set_focus(true);
});
@@ -841,7 +841,7 @@ void MainWidget::redo()
deferred_invoke([this, glyph] {
auto start = m_undo_selection->restored_start();
auto size = m_undo_selection->restored_size();
- m_glyph_map_widget->set_selection(start, size, glyph);
+ m_glyph_map_widget->restore_selection(start, size, glyph);
m_glyph_map_widget->scroll_to_glyph(glyph);
m_glyph_map_widget->set_focus(true);
});