Commit 2203e9ff authored by Aloshi's avatar Aloshi

Fixed crash when RatingComponent's size was 0.

parent 7ca0b0fe
......@@ -44,11 +44,14 @@ void RatingComponent::onSizeChanged()
auto filledSVG = dynamic_cast<SVGResource*>(mFilledTexture.get());
auto unfilledSVG = dynamic_cast<SVGResource*>(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();
}
......
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment