mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
PixelPaint: Avoid infinite loop when updating zoom level ComboBox text
After 8b4e2e20
, `Combobox::set_text()` invokes the `on_change` event by
default. This led to an infinite loop at program startup which caused a
crash.
This commit is contained in:
parent
7a6d84d036
commit
4611a58f8c
Notes:
sideshowbarker
2024-07-16 22:14:49 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/4611a58f8c Pull-request: https://github.com/SerenityOS/serenity/pull/24002 Issue: https://github.com/SerenityOS/serenity/issues/23998
@ -1423,7 +1423,7 @@ ImageEditor& MainWidget::create_new_editor(NonnullRefPtr<Image> image)
|
||||
};
|
||||
|
||||
image_editor.on_scale_change = Core::debounce(100, [this](float scale) {
|
||||
m_zoom_combobox->set_text(ByteString::formatted("{}%", roundf(scale * 100)));
|
||||
m_zoom_combobox->set_text(ByteString::formatted("{}%", roundf(scale * 100)), GUI::AllowCallback::No);
|
||||
current_image_editor()->update_tool_cursor();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user