drawing::rectangle
Structs
CornerRadii
Corner radii, ordered clockwise from top-left.
Pax templates canonically use a list of one to four values such as
corner_radius=[12, 8, 4]. Lists expand using the same clockwise arity rules
as CSS border-radius; a uniform radius may elide the brackets as
corner_radius=12.
The zero-based positional ("magic index") contract depends on list arity:
[all][top-left/bottom-right, top-right/bottom-left][top-left, top-right/bottom-left, bottom-right][top-left, top-right, bottom-right, bottom-left]
A contextual named object remains available as explicit longhand:
corner_radius={ top_left: 12 top_right: 8 bottom_right: 4 bottom_left: 2 }.
The fully type-qualified constructor also remains valid when explicit type
syntax is useful: corner_radius=CornerRadii { top_left: 12 top_right: 8 bottom_right: 4 bottom_left: 2 }.
Interpolation treats each radius independently; zero produces an angular corner.
Properties
top_left
Type: Property<Numeric>
Top-left corner radius.
top_right
Type: Property<Numeric>
Top-right corner radius.
bottom_right
Type: Property<Numeric>
Bottom-right corner radius.
bottom_left
Type: Property<Numeric>
Bottom-left corner radius.
Implementations
resolve_in_graph
pub fn resolve_in_graph(&self) -> RoundedRectRadii
Resolves corner radii from the entered UI graph's settled projections.
radii
pub fn radii(top_left: Numeric, top_right: Numeric, bottom_right: Numeric, bottom_left: Numeric) -> Self
Constructs a CornerRadii value from clockwise corner radii.
Rectangle
A 2D vector rectangle, which covers its bounding box with the specified fill and stroke.
Properties
stroke
Type: Property<Vec<Stroke>>
Ordered outline layers above the fills, index zero topmost. Empty by default.
fill
Type: Property<Vec<Fill>>
Paint painted inside the rectangle.
corner_radius
Type: Property<CornerRadii>
Per-corner radii.