diff options
author | Tim Ledbetter <timledbetter@gmail.com> | 2022-12-17 15:32:37 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-12-17 19:52:11 +0000 |
commit | 53133b4359caf5a8cc5f30d1313759ea4a017870 (patch) | |
tree | c5f715499ed326a47b7e4ab1632ee46842a14f9e /Userland/Applications | |
parent | 7e020154a542bea9665b29cd0a2d6e17249c8e4e (diff) | |
download | serenity-53133b4359caf5a8cc5f30d1313759ea4a017870.zip |
PixelPaint: Debounce ImageEditor on_modified_change event
This limits the frequency of updates performed by the histogram and
vectorscope widgets.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/PixelPaint/MainWidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index e1401a9156..4f2654a57f 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -1075,12 +1075,13 @@ ImageEditor& MainWidget::create_new_editor(NonnullRefPtr<Image> image) m_tab_widget->set_tab_title(image_editor, title); }; - image_editor.on_modified_change = [&](auto const modified) { + image_editor.on_modified_change = Core::debounce([&](auto const modified) { m_tab_widget->set_tab_modified(image_editor, modified); update_window_modified(); m_histogram_widget->image_changed(); m_vectorscope_widget->image_changed(); - }; + }, + 100); image_editor.on_image_mouse_position_change = [&](auto const& mouse_position) { auto const& image_size = current_image_editor()->image().size(); |