[1.15.2] Strange artifacts in guis with scrolling list
HyCraftHD opened this issue ยท 2 comments
Describe the bug
Scrolling in a playlist affects the song information text with strange artifacts
To Reproduce
Steps to reproduce the behavior:
- Go in a playlist with many songs
- Scroll down and see issues witht the yellow text
Expected behavior
- Text should not be influenced when scrolling
Versions
- Mod Version: 2.0.8.52
- Minecraft Version: 1.15.2
- Forge Version: 31.1.0
- UTeamCore Version: 2.10.3.152
Log (if crash occures)
Link to crash log
This bug seems to be tied to the scaling text render in uteamcore.
protected void renderFont(float x, float y) {
GL11.glPushMatrix();
GL11.glTranslatef(x, y, 0);
GL11.glScalef(scale, scale, 0);
if (shadow) {
fontRenderSupplier.get().drawStringWithShadow(text, 0, 0, color);
} else {
fontRenderSupplier.get().drawString(text, 0, 0, color);
}
GL11.glPopMatrix();
}
Here the translation is made with gl but should be now made with the matrix stack.
This in the scrolling text render can be an issue too, because we use glPushMatrix here.
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_SCISSOR_TEST);
GL11.glScissor(nativeX, window.getHeight() - (nativeY + nativeHeight), nativeWidth, nativeHeight);
// Gui.drawRect(0, 0, window.getScaledWidth(), window.getScaledHeight(), 0xFF00FF00); // test scissor
super.draw(getMovingX(x), y + 2);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glPopMatrix();
Issue will be made in uteamcore too