Created
November 26, 2017 21:06
-
-
Save Barteks2x/f82889eaa465668eda8dc487a6f54b1f to your computer and use it in GitHub Desktop.
stdin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick) { | |
ClipArea area = this.getClipArea(); | |
for (UIComponent<?> c : components) { | |
int x = c.screenX(); | |
int y = c.screenY(); | |
int X = x + c.getWidth(); | |
int Y = y + c.getHeight(); | |
if (MathUtil.rangesIntersect(x, X, area.x, area.X) && MathUtil.rangesIntersect(y, Y, area.y, area.Y)) { | |
c.draw(renderer, mouseX, mouseY, partialTick); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment