mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Fixed a rendering issue in ButtonComponent.
This commit is contained in:
parent
77a2383683
commit
d36e64e23a
|
@ -132,7 +132,7 @@ void ButtonComponent::render(const glm::mat4& parentTrans)
|
||||||
if (mTextCache) {
|
if (mTextCache) {
|
||||||
glm::vec3 centerOffset {(mSize.x - mTextCache->metrics.size.x) / 2.0f,
|
glm::vec3 centerOffset {(mSize.x - mTextCache->metrics.size.x) / 2.0f,
|
||||||
(mSize.y - mTextCache->metrics.size.y) / 2.0f, 0.0f};
|
(mSize.y - mTextCache->metrics.size.y) / 2.0f, 0.0f};
|
||||||
trans = glm::translate(trans, centerOffset);
|
trans = glm::translate(trans, glm::round(centerOffset));
|
||||||
|
|
||||||
if (Settings::getInstance()->getBool("DebugText")) {
|
if (Settings::getInstance()->getBool("DebugText")) {
|
||||||
mRenderer->drawRect(centerOffset.x, 0.0f, mTextCache->metrics.size.x, mSize.y,
|
mRenderer->drawRect(centerOffset.x, 0.0f, mTextCache->metrics.size.x, mSize.y,
|
||||||
|
@ -145,7 +145,7 @@ void ButtonComponent::render(const glm::mat4& parentTrans)
|
||||||
|
|
||||||
mTextCache->setColor(getCurTextColor());
|
mTextCache->setColor(getCurTextColor());
|
||||||
mFont->renderTextCache(mTextCache.get());
|
mFont->renderTextCache(mTextCache.get());
|
||||||
trans = glm::translate(trans, -centerOffset);
|
trans = glm::translate(trans, glm::round(-centerOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
renderChildren(trans);
|
renderChildren(trans);
|
||||||
|
|
Loading…
Reference in a new issue