Fix icon button widget crash
This commit is contained in:
parent
5adbb3f16b
commit
8e5304d4a9
@ -370,11 +370,14 @@ void IconButtonWidget::updateIconRect()
|
|||||||
|
|
||||||
if (m_scale_mode == SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO ||
|
if (m_scale_mode == SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO ||
|
||||||
m_scale_mode == SCALE_MODE_LIST_WIDGET)
|
m_scale_mode == SCALE_MODE_LIST_WIDGET)
|
||||||
|
{
|
||||||
|
if (m_texture)
|
||||||
{
|
{
|
||||||
assert(m_texture->getOriginalSize().Height > 0);
|
assert(m_texture->getOriginalSize().Height > 0);
|
||||||
useAspectRatio = (float)m_texture->getOriginalSize().Width /
|
useAspectRatio = (float)m_texture->getOriginalSize().Width /
|
||||||
(float)m_texture->getOriginalSize().Height;
|
(float)m_texture->getOriginalSize().Height;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (m_scale_mode == SCALE_MODE_KEEP_CUSTOM_ASPECT_RATIO)
|
else if (m_scale_mode == SCALE_MODE_KEEP_CUSTOM_ASPECT_RATIO)
|
||||||
{
|
{
|
||||||
useAspectRatio = m_custom_aspect_ratio;
|
useAspectRatio = m_custom_aspect_ratio;
|
||||||
|
Loading…
Reference in New Issue
Block a user