"Simplify" withinExtendedBounds
This commit is contained in:
parent
2fdd33d043
commit
e9cdf90045
@ -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<*>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user