diff options
author | syeyoung <cyong06@naver.com> | 2021-03-10 23:06:05 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-10 23:06:05 +0900 |
commit | 92ce9024b73df31f3c88ad23a7443dec2578469c (patch) | |
tree | dd7f6c928c79e2847a34ccb47820a037d244e361 /src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java | |
parent | a7030786cc5f3b756f8b538f8f071cd7d5c14e77 (diff) | |
download | Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.tar.gz Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.tar.bz2 Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.zip |
finally fix gui flashing issue.
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java index b20b2f33..d6fd8ab4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java @@ -6,6 +6,7 @@ import lombok.Data; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; import java.awt.*; import java.util.ArrayList; @@ -88,8 +89,9 @@ public class StyledTextRenderer { if (stopDraw) return new Dimension(fr.getStringWidth(content), fr.FONT_HEIGHT); - Gui.drawRect(x,y, x+fr.getStringWidth(content), y + fr.FONT_HEIGHT, RenderUtils.getColorAt(x,y, style.getBackground())); + RenderUtils.drawRectSafe(x,y, x+fr.getStringWidth(content), y + fr.FONT_HEIGHT, RenderUtils.getColorAt(x,y, style.getBackground())); + GlStateManager.enableBlend(); if (!style.getColor().isChroma()) { fr.drawString(content, x, y, style.getColor().getRGB(), style.isShadow()); return new Dimension(fr.getStringWidth(content), fr.FONT_HEIGHT); |