diff --git a/src/components/RatingComponent.cpp b/src/components/RatingComponent.cpp index 75266a35b..dccc0a13c 100644 --- a/src/components/RatingComponent.cpp +++ b/src/components/RatingComponent.cpp @@ -44,11 +44,14 @@ void RatingComponent::onSizeChanged() auto filledSVG = dynamic_cast(mFilledTexture.get()); auto unfilledSVG = dynamic_cast(mUnfilledTexture.get()); - size_t sz = (size_t)round(mSize.y()); - if(filledSVG) - filledSVG->rasterizeAt(sz, sz); - if(unfilledSVG) - unfilledSVG->rasterizeAt(sz, sz); + if(mSize.y() > 0) + { + size_t sz = (size_t)round(mSize.y()); + if(filledSVG) + filledSVG->rasterizeAt(sz, sz); + if(unfilledSVG) + unfilledSVG->rasterizeAt(sz, sz); + } updateVertices(); } diff --git a/src/resources/SVGResource.cpp b/src/resources/SVGResource.cpp index 65cee8a97..16b74287f 100644 --- a/src/resources/SVGResource.cpp +++ b/src/resources/SVGResource.cpp @@ -50,7 +50,7 @@ void SVGResource::initFromMemory(const char* file, size_t length) void SVGResource::rasterizeAt(size_t width, size_t height) { - if(!mSVGImage) + if(!mSVGImage || width == 0 || height == 0) return; if(width != (int)round(mSVGImage->width) && height != (int)round(mSVGImage->height))