Improved the NinePatchComponent corner sizing for screens in portrait orientation.

This commit is contained in:
Leon Styhre 2021-10-29 20:10:15 +02:00
parent 063ffd7195
commit 1c79723894

View file

@ -54,7 +54,9 @@ void NinePatchComponent::buildVertices()
delete[] mVertices;
// Scale the corner size relative to the screen resolution.
glm::vec2 relCornerSize = glm::round(mCornerSize * Renderer::getScreenHeightModifier());
glm::vec2 relCornerSize = glm::round(
mCornerSize *
((Renderer::getScreenHeightModifier() + Renderer::getScreenWidthModifier()) / 2.0f));
mTexture = TextureResource::get(mPath, false, false, false);
glm::vec2 texSize = relCornerSize * 3.0f;