diff options
author | syeyoung <cyoung06@naver.com> | 2023-01-25 20:41:26 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-01-25 20:41:26 +0900 |
commit | 9361d8cbaf4c60cf1fd81118e9b299d94c04dbf8 (patch) | |
tree | c717d50dd1c85229175448ee56306bf79320f723 /mod/src/main/java/kr/syeyoung/dungeonsguide | |
parent | b844a5d4665daa27c1450a35c020fdd59e6316ee (diff) | |
download | Skyblock-Dungeons-Guide-9361d8cbaf4c60cf1fd81118e9b299d94c04dbf8.tar.gz Skyblock-Dungeons-Guide-9361d8cbaf4c60cf1fd81118e9b299d94c04dbf8.tar.bz2 Skyblock-Dungeons-Guide-9361d8cbaf4c60cf1fd81118e9b299d94c04dbf8.zip |
- don't clip yourself
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main/java/kr/syeyoung/dungeonsguide')
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/RawRenderingGuiFeature.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/RawRenderingGuiFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/RawRenderingGuiFeature.java index 04ed126f..79541ac5 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/RawRenderingGuiFeature.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/RawRenderingGuiFeature.java @@ -20,6 +20,7 @@ package kr.syeyoung.dungeonsguide.mod.features; import kr.syeyoung.dungeonsguide.mod.guiv2.DomElement; import kr.syeyoung.dungeonsguide.mod.guiv2.Widget; +import kr.syeyoung.dungeonsguide.mod.guiv2.elements.Clip; import kr.syeyoung.dungeonsguide.mod.guiv2.layouter.Layouter; import kr.syeyoung.dungeonsguide.mod.guiv2.primitive.ConstraintBox; import kr.syeyoung.dungeonsguide.mod.guiv2.primitive.Size; @@ -62,19 +63,17 @@ public abstract class RawRenderingGuiFeature extends AbstractHUDFeature { } public OverlayWidget instantiateWidget() { + Clip clip = new Clip(); + clip.widget.setValue(new WidgetFeatureWrapper()); return new OverlayWidget( - new WidgetFeatureWrapper(), + clip, OverlayType.UNDER_CHAT, new GUIRectanglePositioner(this::getFeatureRect) ); } public void drawScreen(float partialTicks) { - Rectangle featureRect = this.getFeatureRect().getRectangleNoScale(); - clip(featureRect.x, featureRect.y, featureRect.width, featureRect.height); - GL11.glEnable(GL11.GL_SCISSOR_TEST); drawHUD(partialTicks); - GL11.glDisable(GL11.GL_SCISSOR_TEST); } @@ -83,13 +82,6 @@ public abstract class RawRenderingGuiFeature extends AbstractHUDFeature { public void drawDemo(float partialTicks) { drawHUD(partialTicks); } - - private void clip(int x, int y, int width, int height) { -// int scale = resolution.getScaleFactor(); - int scale = 1; - GL11.glScissor((x ) * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, (width) * scale, height * scale); - } - public static FontRenderer getFontRenderer() { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; return fr; |