Fix is_hovered on edges

This commit is contained in:
DBotThePony 2021-08-23 18:41:34 +07:00
parent 14f7115639
commit 5af92b5e24
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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() {