Skip to content

Instantly share code, notes, and snippets.

@Barteks2x
Created November 26, 2017 21:06
Show Gist options
  • Save Barteks2x/f82889eaa465668eda8dc487a6f54b1f to your computer and use it in GitHub Desktop.
Save Barteks2x/f82889eaa465668eda8dc487a6f54b1f to your computer and use it in GitHub Desktop.
stdin
@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