mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Fixed crash when RatingComponent's size was 0.
This commit is contained in:
parent
7ca0b0fe72
commit
2203e9ff81
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue