Skip to content

@fabwcie/free-drawing / utils/style

utils/style ​

Functions ​

getShapesStyle() ​

getShapesStyle(nodes): OptionsChange

Defined in: packages/free-drawing/src/utils/style.ts:47

Style of shapes, each part read from the first shape it applies to (color, background of rectangles, ellipses and path shapes, width of outlines, stroke style, corners, path and heads of arrows, text style); parts applying to none of them are left out

Parameters

nodes

(Group | Shape<ShapeConfig>)[]

Drawing shapes or groups (their shapes are read)

Returns

OptionsChange

Style as options of the drawer (see OptionsChange), opacity of the first shape


getTextStyle() ​

getTextStyle(text): TextStyle

Defined in: packages/free-drawing/src/utils/style.ts:17

Text style of a text node, as the text options show it

Parameters

text

Text

Text whose style is read

Returns

TextStyle

Font family, size, style, decoration and alignment of the text