blob: 8d6bb35784e65dd220257b436887809d3dbf8a57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/*
* Roughly Enough Items by Danielshe.
* Licensed under the MIT License.
*/
package me.shedaniel.rei.gui.widget;
import java.awt.*;
public abstract class HighlightableWidget extends Widget {
abstract public Shape getBounds();
public final boolean isHighlighted(int mouseX, int mouseY) {
return isHighlighted((double) mouseX, (double) mouseY);
}
public final boolean isHighlighted(Point point) {
return isHighlighted(point.x, point.y);
}
public boolean isHighlighted(double mouseX, double mouseY) {
return getBounds().contains(mouseX, mouseY);
}
@Override
public boolean isMouseOver(double double_1, double double_2) {
return isHighlighted(double_1, double_2);
}
}
|