Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.15.2] Strange artifacts in guis with scrolling list #34

Closed
HyCraftHD opened this issue Feb 7, 2020 · 2 comments
Closed

[1.15.2] Strange artifacts in guis with scrolling list #34

HyCraftHD opened this issue Feb 7, 2020 · 2 comments
Labels
bug

Comments

@HyCraftHD
Copy link
Member

@HyCraftHD HyCraftHD commented Feb 7, 2020

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

@HyCraftHD HyCraftHD added the bug label Feb 7, 2020
@HyCraftHD

This comment has been minimized.

Copy link
Member Author

@HyCraftHD HyCraftHD commented Feb 7, 2020

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

@HyCraftHD

This comment has been minimized.

Copy link
Member Author

@HyCraftHD HyCraftHD commented Feb 7, 2020

Fixed in uteamcore

@HyCraftHD HyCraftHD closed this Feb 7, 2020
HyCraftHD added a commit that referenced this issue Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.