Skip to content

Documentation / @ripl/core / Shape2DOptions

Type Alias: Shape2DOptions<TState> ​

Shape2DOptions<TState> = ElementOptions<TState> & object

Defined in: packages/core/src/core/shape.ts:27

Options for a 2D shape, adding automatic fill/stroke and clipping controls.

Type Declaration ​

autoFill? ​

optional autoFill?: boolean

Whether the shape automatically fills its path after rendering when a fill is set. Defaults to true.

autoStroke? ​

optional autoStroke?: boolean

Whether the shape automatically strokes its outline after rendering when a stroke is set. Defaults to true.

cachePath? ​

optional cachePath?: boolean

Whether to reuse the traced path across render cycles while the shape is unchanged, avoiding re-tracing on backends that support it. Defaults to true; set false for path renderers that read external mutable data not held in element state.

clip? ​

optional clip?: boolean

Whether the shape's path is used as a clipping region for descendants instead of being filled or stroked. Defaults to false.

Type Parameters ​

Type ParameterDefault type
TState extends BaseElementStateBaseElementState