mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +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
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…
Add table
Add a link
Reference in a new issue