From 76344e9eb57b77c3ef2a6405e8c9752c959d2d0e Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:26:16 +0300 Subject: Use WWidget.isWithinBounds in WPanel.hit --- src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java index b6d0169..a853b24 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java @@ -104,11 +104,10 @@ public abstract class WPanel extends WWidget { if (children.isEmpty()) return this; for(int i=children.size()-1; i>=0; i--) { //Backwards so topmost widgets get priority WWidget child = children.get(i); - if ( x>=child.getX() && - y>=child.getY() && - x