diff options
| author | Linnea Gräf <nea@nea.moe> | 2024-01-10 20:05:21 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2024-01-10 20:26:02 +0100 |
| commit | df4f308005528111f8417c03efe95f1c2cee36bd (patch) | |
| tree | 875398ea290099505e299f234b405b126460864c /src/main/kotlin | |
| parent | 5eb0881e1b470d33a8e02f7d877f9b225516789b (diff) | |
| download | NotEnoughUpdates-df4f308005528111f8417c03efe95f1c2cee36bd.tar.gz NotEnoughUpdates-df4f308005528111f8417c03efe95f1c2cee36bd.tar.bz2 NotEnoughUpdates-df4f308005528111f8417c03efe95f1c2cee36bd.zip | |
Add crash recovery page to PV
Diffstat (limited to 'src/main/kotlin')
| -rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/util/Rectangle.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/Rectangle.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/Rectangle.kt index d44b7721..1882dac4 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/Rectangle.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/Rectangle.kt @@ -31,6 +31,12 @@ data class Rectangle( val x: Int, val y: Int, val width: Int, val height: Int, ) { + val centerX: Int + get() = x + width / 2 + val centerY: Int + get() = y + height / 2 + + /** * The left edge of this rectangle (Low X) */ @@ -69,7 +75,7 @@ data class Rectangle( /** * Check if this rectangle contains the given coordinate */ - fun contains(x1: Int, y1: Int) :Boolean{ + fun contains(x1: Int, y1: Int): Boolean { return left <= x1 && x1 < left + width && top <= y1 && y1 < top + height } } |
