payloadutil and unhelpful commit message

This commit is contained in:
minjaesong
2019-02-20 22:43:35 +09:00
parent c9ac844e75
commit 1906cff519
8 changed files with 200 additions and 92 deletions

View File

@@ -21,6 +21,11 @@ data class Point2d(var x: Double, var y: Double) : Cloneable {
this.y = other.y
}
fun setCoerceIn(start: Point2d, endInclusive: Point2d) {
x = x.coerceIn(start.x, endInclusive.x)
y = y.coerceIn(start.y, endInclusive.y)
}
/**
* Rotate transform this point, with pivot (0, 0)
* @return new Point2d that is rotated