diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java index 5d2d4d67..8c217231 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java @@ -1,6 +1,7 @@ package kr.syeyoung.dungeonsguide.gui.elements; import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; @@ -23,8 +24,8 @@ public class MToggleButton extends MPanel { int gap = 1; - Gui.drawRect(0, 0, bounds.width, bounds.height, 0xFF333333); - Gui.drawRect(gap, gap, bounds.width-gap, bounds.height-gap, 0xFF171717); + RenderUtils.drawRectSafe(0, 0, bounds.width, bounds.height, 0xFF333333); + RenderUtils.drawRectSafe(gap, gap, bounds.width-gap, bounds.height-gap, 0xFF171717); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; @@ -35,14 +36,14 @@ public class MToggleButton extends MPanel { GlStateManager.scale(1.0/scale,1.0/scale,0); fr.drawString("ON", x, x, 0xFF9B9B9B); GlStateManager.popMatrix(); - Gui.drawRect(bounds.width - bounds.height+gap,gap, bounds.width - gap, bounds.height - gap, 0xFF00B200); + RenderUtils.drawRectSafe(bounds.width - bounds.height+gap,gap, bounds.width - gap, bounds.height - gap, 0xFF00B200); } else { GlStateManager.pushMatrix(); GlStateManager.scale(1.0/scale,1.0/scale,0); int x = (int) ((scale * bounds.height - fr.FONT_HEIGHT)/2 + gap); fr.drawString("OFF", (int) (scale * bounds.width - x - fr.getStringWidth("OFF")), x, 0xFF9B9B9B); GlStateManager.popMatrix(); - Gui.drawRect(gap,gap, bounds.height - gap, bounds.height - gap, 0xFFCD4000); + RenderUtils.drawRectSafe(gap,gap, bounds.height - gap, bounds.height - gap, 0xFFCD4000); } } |