From a2d4b2aeb0aefd7709d6d16ca768222c3ce77617 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 10 Sep 2022 21:08:21 +0700 Subject: [PATCH] I love wall of commits --- .../dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt index b5c7e50d9..c7350d13f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt @@ -1041,8 +1041,8 @@ open class EditablePanel @JvmOverloads constructor( } fun withinExtendedBounds(x: Double, y: Double): Boolean { - val pos: ScreenPos = localToScreen(if (childrenRectX < 0) childrenRectX else 0f, if (childrenRectY < 0) childrenRectY else 0f) - val pos2: ScreenPos = localToScreen(if (childrenRectWidth > width) childrenRectWidth else width, if (childrenRectHeight > height) childrenRectHeight else height) + val pos: ScreenPos = localToScreen(childrenRectX.coerceAtMost(0f), childrenRectY.coerceAtMost(0f)) + val pos2: ScreenPos = localToScreen(childrenRectWidth.coerceAtLeast(width), childrenRectHeight.coerceAtLeast(height)) return x in pos.x .. pos2.x && y in pos.y .. pos2.y