RoundedRectangle class

An axis-aligned rectangle with rounded corners.

The rounded parts of the rectangle are symmetrical in x- and y-directions, and across all corners.

Inheritance

Constructors

RoundedRectangle.fromLTRBR(double _left, double _top, double _right, double _bottom, double _radius)
Constructs a RoundedRectangle with left, top, right and bottom edges, and the given radius.
RoundedRectangle.fromPoints(Vector2 a, Vector2 b, double radius)
factory
RoundedRectangle.fromRRect(RRect rrect)
Constructs a RoundedRectangle from ui RRect.
factory

Properties

aabb Aabb2
The axis-aligned bounding box of the shape.
no setteroverride
bottom double
no setter
center Vector2
The central point of the shape.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
height double
no setter
isClosed bool
True if the shape is "closed", in the sense that it has an interior. For example, a closed shape can be filled with a paint.
no setterinherited
isConvex bool
True if the shape is convex, i.e. a line segment connecting any two points of the shape would lie completely within the shape.
no setteroverride
left double
no setter
perimeter double
The length of the shape's boundary. For some more complicated shapes this can be computed approximately.
no setteroverride
radius double
no setter
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
top double
no setter
width double
no setter

Methods

asPath() Path
Converts the shape to a Path object, suitable for rendering on a canvas. If a particular geometric primitive cannot be represented as a Path faithfully, an approximate path can be returned.
override
asRRect() RRect
Converts this shape into an RRect from dart:ui.
containsPoint(Vector2 point) bool
Returns true if the given point is inside the shape or on the boundary.
override
move(Vector2 offset) → void
Translates the shape by the specified offset vector, in-place.
override
nearestPoint(Vector2 point) Vector2
Returns a point on the shape's boundary which is closest to the given point.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
project(Transform2D transform, [Shape? target]) Shape
Returns the result of applying an affine transformation to the shape.
override
randomPoint({Random? random, bool within = true}) Vector2
Returns a random point within the shape if within is true (default) and otherwise a point along the edges of the shape. Do note that within=true also includes the edges.
override
support(Vector2 direction) Vector2
Finds the intersection of this shape with another one, if it exists. Returns a point on the boundary that is furthest in the given direction.
override
toString() String
A string representation of this object.
override

Operators

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