summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/util/ext/Math.kt')
-rw-r--r--src/main/kotlin/io/dico/parcels2/util/ext/Math.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt b/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
index 32540fd..62ee220 100644
--- a/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
+++ b/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
@@ -29,4 +29,7 @@ fun IntRange.clamp(min: Int, max: Int): IntRange {
return IntRange(first, max)
}
return this
-} \ No newline at end of file
+}
+
+// the name coerceAtMost is bad
+fun Int.clampMax(max: Int) = coerceAtMost(max) \ No newline at end of file