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 04b075e3d..b5c7e50d9 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 @@ -1042,9 +1042,10 @@ 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) - return x in pos.x .. absoluteX + (if (childrenRectWidth > width) childrenRectWidth else width) && - y in pos.y .. absoluteY + (if (childrenRectHeight > height) childrenRectHeight else height) + return x in pos.x .. pos2.x && + y in pos.y .. pos2.y } fun killFocusForEverythingExcept(except: EditablePanel<*>) {