diff options
author | syeyoung <cyong06@naver.com> | 2021-02-05 17:29:09 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-05 17:29:09 +0900 |
commit | 6b4e2499ece7f4328381a88380baea85fe24246d (patch) | |
tree | 07a1da8b9d2b6f543d5905a29adc2a5a1c46736d /src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java | |
parent | 3d20d63e025b827ae9a8e7bd62b436fda7986071 (diff) | |
download | Skyblock-Dungeons-Guide-6b4e2499ece7f4328381a88380baea85fe24246d.tar.gz Skyblock-Dungeons-Guide-6b4e2499ece7f4328381a88380baea85fe24246d.tar.bz2 Skyblock-Dungeons-Guide-6b4e2499ece7f4328381a88380baea85fe24246d.zip |
Gui Overhaul part 1
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java index 4eae2298..50d5b85f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java @@ -42,6 +42,8 @@ public class MPanel { return getBounds().getSize(); } + public Dimension getPreferredSize() { return getSize(); } + public void setBounds(Rectangle bounds) { if (bounds == null) return; this.bounds.x = bounds.x; @@ -69,7 +71,6 @@ public class MPanel { public void render0(ScaledResolution resolution, Point parentPoint, Rectangle parentClip, int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks) { // 0,0 - a a - int relMousex = relMousex0 - getBounds().x; int relMousey = relMousey0 - getBounds().y; @@ -97,7 +98,7 @@ public class MPanel { GlStateManager.popMatrix(); GL11.glDisable(GL11.GL_SCISSOR_TEST); - GL11.glPopAttrib(); + GlStateManager.popAttrib(); Point newPt = new Point(parentPoint.x + getBounds().x, parentPoint.y + getBounds().y); @@ -112,6 +113,8 @@ public class MPanel { } public void clip(ScaledResolution resolution, int x, int y, int width, int height) { + if (width < 0 || height < 0) return; + int scale = resolution.getScaleFactor(); GL11.glScissor((x ) * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, (width) * scale, height * scale); } |