Skip to content

Commit d2b2a98

Browse files
committed
Don't try to rasterize SVG to texture without size (fixes #387)
1 parent 6b7a914 commit d2b2a98

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/Sprite.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ namespace tgui
409409
const Vector2u svgTextureSize{static_cast<unsigned int>(std::round(getSize().x)),
410410
static_cast<unsigned int>(std::round(getSize().y))};
411411

412-
m_texture.getData()->svgImage->rasterize(*m_svgTexture, svgTextureSize);
412+
if (svgTextureSize.x > 0 && svgTextureSize.y > 0)
413+
m_texture.getData()->svgImage->rasterize(*m_svgTexture, svgTextureSize);
413414

414415
m_scalingType = ScalingType::Normal;
415416
textureSize = getSize();

0 commit comments

Comments
 (0)