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 }.

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

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<Stroke>

Stroke drawn around the rectangle.

fill

Type: Property<Fill>

Fill painted inside the rectangle.

material

Type: Property<Material>

Light-reactive surface response.

corner_radius

Type: Property<CornerRadii>

Per-corner radii.