mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
Make new resizing algorithm actually work properly.
This commit is contained in:
parent
b35d365dc8
commit
a83ce289e0
|
@ -67,13 +67,15 @@ void ImageComponent::resize()
|
|||
// if only one component is set, we resize in a way that maintains aspect ratio
|
||||
if(!mTargetSize.x() && mTargetSize.y())
|
||||
{
|
||||
mSize[0] = (mTargetSize.y() / mSize.y()) * mSize.x();
|
||||
mSize[0] = (mTargetSize.y() / textureSize.y()) * textureSize.x();
|
||||
mSize[1] = mTargetSize.y();
|
||||
}else if(mTargetSize.x() && !mTargetSize.y())
|
||||
{
|
||||
mSize[0] = mTargetSize.x();
|
||||
mSize[1] = (mTargetSize.x() / mSize.x()) * mSize.y();
|
||||
mSize[1] = (mTargetSize.x() / textureSize.x()) * textureSize.y();
|
||||
}
|
||||
|
||||
LOG(LogInfo) << "resized to: " << mSize.x() << ", " << mSize.y();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue