Rectangle

external class Rectangle : Shape

Constructors

Link copied to clipboard
constructor()
constructor(x1: int, y1: int, width1: int, height1: int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var height: int
Link copied to clipboard
var width: int
Link copied to clipboard
var x: int
Link copied to clipboard
var y: int

Functions

Link copied to clipboard
Link copied to clipboard
open override fun contains(pt: Point2D): Boolean
open override fun contains(x: int, y: int): Boolean
open override fun contains(x: int, y: int, width: int, height: int): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getBounds(): Rectangle
Link copied to clipboard
open override fun getBounds2D(): Rectangle2D
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getHeight(): int
Link copied to clipboard
fun getMaxX(): int
Link copied to clipboard
fun getMaxY(): int
Link copied to clipboard
fun getMinX(): int
Link copied to clipboard
fun getMinY(): int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getWidth(): int
Link copied to clipboard
fun getX(): double
Link copied to clipboard
fun getY(): int
Link copied to clipboard
fun grow(h: int, v: int)
Link copied to clipboard
open override fun intersects(rect: Rectangle2D): Boolean
open override fun intersects(x: double, y: double, w: double, h: double): Boolean
Link copied to clipboard
fun intersectsLine(x1: Double, y1: Double, x2: Double, y2: Double): Boolean

Tests if the specified line segment intersects the interior of this Rectangle. Ported from java.

Link copied to clipboard
Link copied to clipboard

setLocation x,y (top,left) while maintaining the width and height.

Link copied to clipboard
Link copied to clipboard
fun setRect(rect: Rectangle)
Link copied to clipboard
fun shift(x: Double, y: Double)
Link copied to clipboard
fun shiftBR(x: Double, y: Double)

moves bottom,right points leaving top,left intact. adjusts the height & width values as necessary

Link copied to clipboard
fun shiftTL(x: Double, y: Double)

moves top,left points leaving bottom,right intact. adjusts the height & width values as necessary

Link copied to clipboard
Link copied to clipboard
fun toSVGElement(stroke: String?, strokeWidth: Double, fill: String?): String
Link copied to clipboard
fun union(rect: Rectangle)

Will merge the bounds of two rectangle.

Link copied to clipboard
fun unionPoint(point: Point)