Fixed two casting issues.

This commit is contained in:
Leon Styhre 2021-10-23 15:53:31 +02:00
parent 6cee6d2732
commit dd94aeec96
2 changed files with 4 additions and 5 deletions

View file

@ -102,11 +102,10 @@ void RatingComponent::onSizeChanged()
mSize.x = mSize.y * NUM_RATING_STARS;
if (mSize.y > 0.0f) {
size_t heightPx = static_cast<size_t>(std::round(mSize.y));
if (mFilledTexture)
mFilledTexture->rasterizeAt(heightPx, heightPx);
mFilledTexture->rasterizeAt(mSize.y, mSize.y);
if (mUnfilledTexture)
mUnfilledTexture->rasterizeAt(heightPx, heightPx);
mUnfilledTexture->rasterizeAt(mSize.y, mSize.y);
}
updateVertices();

View file

@ -147,8 +147,8 @@ bool TextureData::initFromRGBA(const unsigned char* dataRGBA, size_t width, size
mDataRGBA.reserve(width * height * 4);
mDataRGBA.insert(mDataRGBA.begin(), dataRGBA, dataRGBA + (width * height * 4));
mWidth = width;
mHeight = height;
mWidth = static_cast<int>(width);
mHeight = static_cast<int>(height);
return true;
}