Skip to content

Commit

Permalink
Deprecate Rectangle.xD, .yD, .widthD, .heightD (#1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz authored Oct 11, 2023
1 parent 841f265 commit 6030a5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions korge-foundation/src/common/korlibs/math/geom/Rectangle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ data class RectangleD(val x: Double, val y: Double, val width: Double, val heigh
val position: Point get() = Point(x, y)
val size: Size get() = Size(width, height)

val xD: Double get() = x.toDouble()
val yD: Double get() = y.toDouble()
val widthD: Double get() = width.toDouble()
val heightD: Double get() = height.toDouble()
@Deprecated("", ReplaceWith("x"))
val xD: Double get() = x
@Deprecated("", ReplaceWith("y"))
val yD: Double get() = y
@Deprecated("", ReplaceWith("width"))
val widthD: Double get() = width
@Deprecated("", ReplaceWith("height"))
val heightD: Double get() = height

val isZero: Boolean get() = this == ZERO
val isInfinite: Boolean get() = this == INFINITE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ interface VectorBuilder {
fun roundRect(rect: RoundRectangle) {
val r = rect.rect
val c = rect.corners
roundRect(r.xD, r.yD, r.widthD, r.heightD, c.topLeft.toDouble(), c.topRight.toDouble(), c.bottomLeft.toDouble(), c.bottomRight.toDouble())
roundRect(r.x, r.y, r.width, r.height, c.topLeft, c.topRight, c.bottomLeft, c.bottomRight)
}

fun roundRect(x: Double, y: Double, w: Double, h: Double, rx: Double, ry: Double = rx) {
Expand Down

0 comments on commit 6030a5b

Please sign in to comment.