fix hover checker for widgets
@@ -20,16 +20,19 @@ public class HoverChecker
public HoverChecker(Widget widget)
{
- this(widget.x, widget.x + widget.getHeight(), widget.y, widget.y + widget.getWidth()); //x, y, getWidth
+ this(widget.x, widget.x + widget.getHeight(), widget.y, widget.y + widget.getWidth());
this.widget = widget;
}
public boolean checkHover(int mouseX, int mouseY)
{
- if(widget != null && !widget.visible) //visible
+ if(widget != null)
+ {
+ if(!widget.visible)
return false;
-
- return mouseX >= left && mouseX <= right && mouseY >= top && mouseY <= bottom;
+ else return widget.isHovered();
+ }
+ else return mouseX >= left && mouseX <= right && mouseY >= top && mouseY <= bottom;
}
}
