Graphics/TextSprite: Fix scale not affecting bounding volume
This commit is contained in:
parent
c4e837b14f
commit
3ae5bfad63
|
|
@ -149,6 +149,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_scale = scale;
|
m_scale = scale;
|
||||||
|
|
||||||
|
InvalidateBoundingVolume();
|
||||||
InvalidateVertices();
|
InvalidateVertices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -200,8 +200,8 @@ namespace Nz
|
||||||
void TextSprite::MakeBoundingVolume() const
|
void TextSprite::MakeBoundingVolume() const
|
||||||
{
|
{
|
||||||
Rectf bounds(m_localBounds);
|
Rectf bounds(m_localBounds);
|
||||||
Vector2f max = bounds.GetMaximum();
|
Vector2f max = m_scale * bounds.GetMaximum();
|
||||||
Vector2f min = bounds.GetMinimum();
|
Vector2f min = m_scale * bounds.GetMinimum();
|
||||||
|
|
||||||
m_boundingVolume.Set(min.x * Vector3f::Right() + min.y * Vector3f::Down(), max.x * Vector3f::Right() + max.y * Vector3f::Down());
|
m_boundingVolume.Set(min.x * Vector3f::Right() + min.y * Vector3f::Down(), max.x * Vector3f::Right() + max.y * Vector3f::Down());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue