I love wall of commits

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

View File

@ -1041,8 +1041,8 @@ open class EditablePanel<out S : Screen> @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