mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 20:55:35 +03:00
PixelPaint: Debounce ImageEditor on_modified_change event
This limits the frequency of updates performed by the histogram and vectorscope widgets.
This commit is contained in:
parent
7e020154a5
commit
53133b4359
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/53133b4359 Pull-request: https://github.com/SerenityOS/serenity/pull/16546 Reviewed-by: https://github.com/nico ✅
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user