mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 06:42:56 +00:00
Fix text color leaking from scroll list into scroll bar
This commit is contained in:
2 files changed
+5
No files matched your search
@@ -3,6 +3,7 @@ package mekanism.client.gui.element;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
@@ -73,6 +74,8 @@ public abstract class GuiElement {
|
||||
getFontRenderer().drawString(text, (int) (x * reverse), (int) ((y * reverse) + yAdd), color);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
//Make sure the color does not leak from having drawn the string
|
||||
MekanismRenderer.resetColor();
|
||||
}
|
||||
|
||||
public FontRenderer getFontRenderer() {
|
||||
|
||||
@@ -130,6 +130,8 @@ public class GuiScrollList extends GuiElement {
|
||||
|
||||
@Override
|
||||
public void renderForeground(int xAxis, int yAxis) {
|
||||
//TODO: For some reason the entire gui scroll list element gets its color shifted when GuiScreen#drawHoveringText is being drawn
|
||||
// Resetting the color here does not seem to do anything to help fix this
|
||||
if (!textEntries.isEmpty()) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
int index = getScrollIndex() + i;
|
||||
|
||||
Reference in new issue
Block a user