mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Window corner sizes are now calculated based on the screen height instead of the screen width.
This commit is contained in:
parent
3dea4bc8ec
commit
e957e96e20
|
@ -54,7 +54,12 @@ void NinePatchComponent::buildVertices()
|
||||||
// Scale the corner size relative to the screen resolution, but keep the scale factor
|
// Scale the corner size relative to the screen resolution, but keep the scale factor
|
||||||
// within reason as extreme resolutions may cause artifacts. Any "normal" resolution
|
// within reason as extreme resolutions may cause artifacts. Any "normal" resolution
|
||||||
// (e.g. from 720p to 4K) will be within these boundaries though.
|
// (e.g. from 720p to 4K) will be within these boundaries though.
|
||||||
float scaleFactor = Math::clamp(Renderer::getScreenWidthModifier(), 0.4f, 3.0f);
|
float scaleFactor;
|
||||||
|
if (Renderer::getScreenWidth() > Renderer::getScreenHeight())
|
||||||
|
scaleFactor = Math::clamp(Renderer::getScreenHeightModifier(), 0.4f, 3.0f);
|
||||||
|
else
|
||||||
|
scaleFactor = Math::clamp(Renderer::getScreenWidthModifier(), 0.4f, 3.0f);
|
||||||
|
|
||||||
mTexture = TextureResource::get(mPath, false, false, true, scaleFactor);
|
mTexture = TextureResource::get(mPath, false, false, true, scaleFactor);
|
||||||
|
|
||||||
if (mTexture->getSize() == Vector2i::Zero()) {
|
if (mTexture->getSize() == Vector2i::Zero()) {
|
||||||
|
|
Loading…
Reference in a new issue