Widgets/SimpleWidgetStyles: Fix hovered sprite not being detached on click
This commit is contained in:
parent
24bc1dac1c
commit
f1ee611378
|
|
@ -316,8 +316,11 @@ namespace Nz
|
||||||
if (!pressed)
|
if (!pressed)
|
||||||
m_sprite->SetMaterial(owner->GetMaterial());
|
m_sprite->SetMaterial(owner->GetMaterial());
|
||||||
|
|
||||||
GraphicsComponent& gfxComponent = GetRegistry().get<GraphicsComponent>(m_entity);
|
if (!m_isHovered)
|
||||||
gfxComponent.AttachRenderable(m_hoveredSprite, GetRenderMask());
|
{
|
||||||
|
GraphicsComponent& gfxComponent = GetRegistry().get<GraphicsComponent>(m_entity);
|
||||||
|
gfxComponent.AttachRenderable(m_hoveredSprite, GetRenderMask());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -325,8 +328,11 @@ namespace Nz
|
||||||
if (!pressed)
|
if (!pressed)
|
||||||
m_sprite->SetMaterial(owner->GetMaterial());
|
m_sprite->SetMaterial(owner->GetMaterial());
|
||||||
|
|
||||||
GraphicsComponent& gfxComponent = GetRegistry().get<GraphicsComponent>(m_entity);
|
if (m_isHovered)
|
||||||
gfxComponent.DetachRenderable(m_hoveredSprite);
|
{
|
||||||
|
GraphicsComponent& gfxComponent = GetRegistry().get<GraphicsComponent>(m_entity);
|
||||||
|
gfxComponent.DetachRenderable(m_hoveredSprite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue