PRectangle class

A PCanvas rectangle.

Inheritance
Implemented types
Available extensions

Constructors

PRectangle(num x, num y, num width, num height)
const
PRectangle.fromCoordinates(num x1, num y1, num x2, num y2)
factory
PRectangle.fromDimension(num x, num y, PDimension dimension)
PRectangle.fromJson(Map<String, dynamic> j)
factory
PRectangle.fromPoints(Point p1, Point p2)
factory

Properties

area num
The area of this dimension.
no setterinherited
asPath2D Path2D

Available on PRectangle, provided by the PRectangleHTMLExtension extension

no setter
aspectRation double
The aspect ration of this dimension (width / height).
no setterinherited
center Point
The center Point of this rectangle.
no setteroverride
className String
no setterinherited
dimension PRectangle
The PDimension of this instance.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
height num
The dimension height.
finalinherited
isZeroDimension bool
Returns true if the area of this dimension is zero.
no setterinherited
maxX num
Returns: x + width
no setter
maxY num
Returns: y + height
no setter
minX num
Returns x.
no setter
minY num
Returns y.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width num
The dimension width.
finalinherited
x num
The X coordinate.
final
y num
The Y coordinate.
final

Methods

contains(num x, num y, num width, num height) bool
Returns true if this rectangle contains the rectangle x,y , width,height.
containsPoint(Point p) bool
Returns true if this rectangle contains the point p.
containsRectangle(PRectangle r) bool
Returns true if this rectangle contains the rectangle r.
containsXY(num x, num y) bool
Returns true if this rectangle contains the coordinates x,y.
copyWith({num? x, num? y, num? width, num? height}) PRectangle
incrementHeight(num n) PRectangle
Increments height by n.
incrementWH(num nW, num nH) PRectangle
Increments width,height by nW,nH.
incrementWidth(num n) PRectangle
Increments width by n.
incrementX(num n) PRectangle
Increments x by n.
incrementXY(num nX, num nY) PRectangle
Increments x,y by nX,nY,
incrementY(num n) PRectangle
Increments y by n.
intersection(PRectangle r) PRectangle
Returns the intersection between this rectangle and r.
intersects(num x, num y, num width, num height) bool
Returns true this rectangle intersects with x,y , width,height.
intersectsRectangle(PRectangle r) bool
Returns true if r intersects this rectangle.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve() PRectangle
Returns a resolved version of this instance.
override
setHeight(num height) PDimension
inherited
setWidth(num width) PDimension
inherited
toJson() Map<String, dynamic>
override
toJsonEncoded({bool pretty = false}) String

Available on WithJson, provided by the WithJsonExtension extension

toPRectangle({num x = 0, num y = 0}) PRectangle
inherited
toString() String
A string representation of this object.
override
transform(PcanvasTransform t) PRectangle
translate(num x, num y) PRectangle
Translate this rectangle.

Operators

operator ==(Object other) bool
The equality operator.
override