mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
PixelPaint: Don't select the same layer twice in LayerListWidget
Without this check we would do an unnecessary partial second round trip because of the call chain: LayerListWidget::set_selected_layer() -> LayerListWidget::on_layer_select() -> ImageEditor::set_active_layer() -> ImageEditor::on_active_layer_change() -> LayerListWidget::set_selected_layer()
This commit is contained in:
parent
eaa99968fb
commit
b76fe6357a
Notes:
sideshowbarker
2024-07-18 03:52:42 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/b76fe6357a2 Pull-request: https://github.com/SerenityOS/serenity/pull/10061
1 changed files with 4 additions and 0 deletions
|
@ -342,6 +342,10 @@ void LayerListWidget::set_selected_layer(Layer* layer)
|
|||
{
|
||||
if (!m_image)
|
||||
return;
|
||||
|
||||
if (layer->is_selected())
|
||||
return;
|
||||
|
||||
for (size_t i = 0; i < m_image->layer_count(); ++i) {
|
||||
if (layer == &m_image->layer(i)) {
|
||||
m_image->layer(i).set_selected(true);
|
||||
|
|
Loading…
Reference in a new issue