mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 10:36:24 +00: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
|
@ -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 a new issue