"Simplify" withinExtendedBounds

This commit is contained in:
DBotThePony 2022-09-10 21:07:09 +07:00
parent 2fdd33d043
commit e9cdf90045
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1042,9 +1042,10 @@ open class EditablePanel<out S : Screen> @JvmOverloads constructor(
fun withinExtendedBounds(x: Double, y: Double): Boolean { fun withinExtendedBounds(x: Double, y: Double): Boolean {
val pos: ScreenPos = localToScreen(if (childrenRectX < 0) childrenRectX else 0f, if (childrenRectY < 0) childrenRectY else 0f) 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) && return x in pos.x .. pos2.x &&
y in pos.y .. absoluteY + (if (childrenRectHeight > height) childrenRectHeight else height) y in pos.y .. pos2.y
} }
fun killFocusForEverythingExcept(except: EditablePanel<*>) { fun killFocusForEverythingExcept(except: EditablePanel<*>) {