From 3ae5bfad6375fd3b37983cfa3396cec3cfd25eed Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 24 Nov 2016 09:40:04 +0100 Subject: [PATCH] Graphics/TextSprite: Fix scale not affecting bounding volume --- include/Nazara/Graphics/TextSprite.inl | 1 + src/Nazara/Graphics/TextSprite.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/Nazara/Graphics/TextSprite.inl b/include/Nazara/Graphics/TextSprite.inl index 2ed880a38..d5db90805 100644 --- a/include/Nazara/Graphics/TextSprite.inl +++ b/include/Nazara/Graphics/TextSprite.inl @@ -149,6 +149,7 @@ namespace Nz { m_scale = scale; + InvalidateBoundingVolume(); InvalidateVertices(); } diff --git a/src/Nazara/Graphics/TextSprite.cpp b/src/Nazara/Graphics/TextSprite.cpp index 42dba4aaf..42a54b66f 100644 --- a/src/Nazara/Graphics/TextSprite.cpp +++ b/src/Nazara/Graphics/TextSprite.cpp @@ -200,8 +200,8 @@ namespace Nz void TextSprite::MakeBoundingVolume() const { Rectf bounds(m_localBounds); - Vector2f max = bounds.GetMaximum(); - Vector2f min = bounds.GetMinimum(); + Vector2f max = m_scale * bounds.GetMaximum(); + 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()); }