mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
Final Fix for resizing images
This commit is contained in:
parent
68dff607c8
commit
21f21d8268
|
@ -62,7 +62,7 @@ void ImageComponent::resize()
|
||||||
// we need to make sure we're not creating an image larger than max size
|
// we need to make sure we're not creating an image larger than max size
|
||||||
mSize[1] = Math::min(Math::round(mSize[1] *= resizeScale.x()), mTargetSize.y());
|
mSize[1] = Math::min(Math::round(mSize[1] *= resizeScale.x()), mTargetSize.y());
|
||||||
}else{
|
}else{
|
||||||
mSize[1] = Math::round(mSize[1] *= resizeScale.y()); // this will be mTargetSize.y(). We can't exceed it.
|
mSize[1] = Math::round(mSize[1] * resizeScale.y()); // this will be mTargetSize.y(). We can't exceed it.
|
||||||
|
|
||||||
// for SVG rasterization, always calculate width from rounded height (see comment above)
|
// for SVG rasterization, always calculate width from rounded height (see comment above)
|
||||||
// we need to make sure we're not creating an image larger than max size
|
// we need to make sure we're not creating an image larger than max size
|
||||||
|
@ -112,8 +112,11 @@ void ImageComponent::resize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSize[0] = Math::round(mSize.x());
|
||||||
|
mSize[1] = Math::round(mSize.y());
|
||||||
// mSize.y() should already be rounded
|
// mSize.y() should already be rounded
|
||||||
mTexture->rasterizeAt((size_t)Math::round(mSize.x()), (size_t)Math::round(mSize.y()));
|
mTexture->rasterizeAt((size_t)mSize.x(), (size_t)mSize.y());
|
||||||
|
|
||||||
onSizeChanged();
|
onSizeChanged();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue