Fix is_hovered on edges
This commit is contained in:
parent
14f7115639
commit
5af92b5e24
@ -148,7 +148,7 @@ public class EditablePanel implements GuiEventListener {
|
|||||||
parent_x = x;
|
parent_x = x;
|
||||||
parent_y = y;
|
parent_y = y;
|
||||||
} else {
|
} else {
|
||||||
is_hovered = parent.is_hovered && mouse_x >= parent_x && mouse_x <= parent_x + width && mouse_y >= parent_y && mouse_y <= parent_y + height;
|
is_hovered = parent.is_hovered && mouse_x >= parent_x && mouse_x < parent_x + width && mouse_y >= parent_y && mouse_y < parent_y + height;
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.pushPose();
|
stack.pushPose();
|
||||||
@ -173,7 +173,7 @@ public class EditablePanel implements GuiEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean tickHover(float mouse_x, float mouse_y) {
|
public boolean tickHover(float mouse_x, float mouse_y) {
|
||||||
return is_hovered = mouse_x >= x && mouse_y >= y && mouse_x <= x + width && mouse_y <= y + height;
|
return is_hovered = mouse_x >= x && mouse_y >= y && mouse_x < x + width && mouse_y < y + height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unsetHover() {
|
public void unsetHover() {
|
||||||
|
Loading…
Reference in New Issue
Block a user