mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
Improved the sizing of screen corners in NinePatchComponent.
This commit is contained in:
parent
c4fb3eafbe
commit
6a7f002a94
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "ThemeData.h"
|
#include "ThemeData.h"
|
||||||
|
#include "resources/Font.h"
|
||||||
#include "resources/TextureResource.h"
|
#include "resources/TextureResource.h"
|
||||||
|
|
||||||
NinePatchComponent::NinePatchComponent(Window* window,
|
NinePatchComponent::NinePatchComponent(Window* window,
|
||||||
|
@ -60,10 +61,10 @@ void NinePatchComponent::buildVertices()
|
||||||
relCornerSize = mCornerSize;
|
relCornerSize = mCornerSize;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Scale the corner size relative to the screen resolution.
|
// Scale the corner size relative to the screen resolution (using the medium sized
|
||||||
|
// default font as size reference).
|
||||||
relCornerSize = glm::round(
|
relCornerSize = glm::round(
|
||||||
mCornerSize *
|
mCornerSize * (Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.0568f / 2.0f));
|
||||||
((Renderer::getScreenHeightModifier() + Renderer::getScreenWidthModifier()) / 2.0f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mTexture = TextureResource::get(mPath, false, false, false);
|
mTexture = TextureResource::get(mPath, false, false, false);
|
||||||
|
|
Loading…
Reference in a new issue