Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Support single argument for inflate (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Jan 2, 2021
1 parent 42cc0e1 commit 7662fb5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ data class Rectangle(
return out.setTo(x, y, ow, oh)
}

fun inflate(dx: Double, dy: Double) {
fun inflate(dx: Double, dy: Double = dx) {
x -= dx; width += 2 * dx
y -= dy; height += 2 * dy
}
fun inflate(dx: Float, dy: Float) = inflate(dx.toDouble(), dy.toDouble())
fun inflate(dx: Int, dy: Int) = inflate(dx.toDouble(), dy.toDouble())
fun inflate(dx: Float, dy: Float = dx) = inflate(dx.toDouble(), dy.toDouble())
fun inflate(dx: Int, dy: Int = dx) = inflate(dx.toDouble(), dy.toDouble())

fun clear() = setTo(0.0, 0.0, 0.0, 0.0)

Expand Down

0 comments on commit 7662fb5

Please sign in to comment.