mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Fixed some graphical glitches in NinePatchComponent and ButtonComponent.
This commit is contained in:
parent
dbfab96e03
commit
440e089847
|
@ -133,6 +133,7 @@ void ButtonComponent::render(const glm::mat4& parentTrans)
|
||||||
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, centerOffset);
|
||||||
|
trans[3] = glm::round(trans[3]);
|
||||||
|
|
||||||
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,
|
||||||
|
|
|
@ -132,6 +132,7 @@ void NinePatchComponent::render(const glm::mat4& parentTrans)
|
||||||
glm::mat4 trans {parentTrans * getTransform()};
|
glm::mat4 trans {parentTrans * getTransform()};
|
||||||
|
|
||||||
if (mTexture && mVertices != nullptr) {
|
if (mTexture && mVertices != nullptr) {
|
||||||
|
trans[3] = glm::round(trans[3]);
|
||||||
mRenderer->setMatrix(trans);
|
mRenderer->setMatrix(trans);
|
||||||
mVertices->opacity = mOpacity;
|
mVertices->opacity = mOpacity;
|
||||||
mTexture->bind();
|
mTexture->bind();
|
||||||
|
|
Loading…
Reference in a new issue