MCPcopy Create free account
hub / github.com/core7s/react-design-editor / getTextOptions

Function getTextOptions

src/utils/object-options.ts:14–42  ·  view source on GitHub ↗
(selection: any)

Source from the content-addressed store, hash-verified

12 }
13}
14export const getTextOptions = (selection: any) => {
15 const selectionMetadata = getSelectionMetadata(selection)
16 if (selection._objects) {
17 const object = selection._objects[0]
18 const { underline, textAlign, fontSize, fill, charSpacing, lineHeight, fontFamily } = object
19 return {
20 underline,
21 textAlign,
22 fontSize,
23 fill,
24 charSpacing,
25 lineHeight,
26 fontFamily,
27 ...selectionMetadata,
28 }
29 } else {
30 const { underline, textAlign, fontSize, fill, charSpacing, lineHeight, fontFamily } = selection
31 return {
32 underline,
33 textAlign,
34 fontSize,
35 fill,
36 charSpacing,
37 lineHeight,
38 fontFamily,
39 ...selectionMetadata,
40 }
41 }
42}

Callers 1

TextPropertiesFunction · 0.90

Calls 1

getSelectionMetadataFunction · 0.85

Tested by

no test coverage detected