Music Player

Music Player

3M Downloads

[1.15.2] Strange artifacts in guis with scrolling list

HyCraftHD opened this issue ยท 2 comments

commented

Describe the bug
Scrolling in a playlist affects the song information text with strange artifacts

To Reproduce
Steps to reproduce the behavior:

  1. Go in a playlist with many songs
  2. Scroll down and see issues witht the yellow text

Expected behavior

  • Text should not be influenced when scrolling

Screenshots
grafik

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

commented

This bug seems to be tied to the scaling text render in uteamcore.

https://github.com/MC-U-Team/U-Team-Core/blob/19ed7118b57801b9c5ffe67053f469f6fd1b3d8f/src/main/java/info/u_team/u_team_core/gui/render/ScalingTextRender.java#L86-L96

	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.

https://github.com/MC-U-Team/U-Team-Core/blob/19ed7118b57801b9c5ffe67053f469f6fd1b3d8f/src/main/java/info/u_team/u_team_core/gui/render/ScrollingTextRender.java#L82-L91

		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

commented

Fixed in uteamcore