From 5af92b5e249c9b7ef5556eb5ecf3efe2c9724235 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 23 Aug 2021 18:41:34 +0700 Subject: [PATCH] Fix is_hovered on edges --- .../ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java b/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java index 0415eb990..036c37e9c 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java +++ b/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java @@ -148,7 +148,7 @@ public class EditablePanel implements GuiEventListener { parent_x = x; parent_y = y; } 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(); @@ -173,7 +173,7 @@ public class EditablePanel implements GuiEventListener { } 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() {