mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidget
Using a WeakPtr to keep a reference to the active layer caused it to be destroyed when the last tab was closed, which made the m_layer == layer check in set_layer() return early since it was already null. Because of this the LayerPropertiesWidget was never disabled.
This commit is contained in:
parent
7ca4d045bd
commit
18e6da6d4d
2 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,7 @@ void LayerPropertiesWidget::set_layer(Layer* layer)
|
|||
return;
|
||||
|
||||
if (layer) {
|
||||
m_layer = layer->make_weak_ptr();
|
||||
m_layer = layer;
|
||||
m_name_textbox->set_text(layer->name());
|
||||
m_opacity_slider->set_value(layer->opacity_percent());
|
||||
m_visibility_checkbox->set_checked(layer->is_visible());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue