MCPcopy
hub / github.com/airbnb/react-sketchapp / makeShapePath

Function makeShapePath

src/jsonUtils/shapeLayers.ts:112–143  ·  view source on GitHub ↗
(
  frame: FileFormat.Rect,
  path: Pick<FileFormat.ShapePath, 'isClosed' | 'points'>,
  resizingConstraint?: ResizeConstraints,
)

Source from the content-addressed store, hash-verified

110};
111
112export const makeShapePath = (
113 frame: FileFormat.Rect,
114 path: Pick<FileFormat.ShapePath, 'isClosed' | 'points'>,
115 resizingConstraint?: ResizeConstraints,
116): FileFormat.ShapePath => ({
117 _class: 'shapePath',
118 frame,
119 do_objectID: generateID(),
120 isFlippedHorizontal: false,
121 isFlippedVertical: false,
122 isLocked: false,
123 isVisible: true,
124 layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
125 name: 'Path',
126 nameIsFixed: false,
127 resizingConstraint: makeResizeConstraint(resizingConstraint),
128 resizingType: FileFormat.ResizeType.Stretch,
129 rotation: 0,
130 shouldBreakMaskChain: false,
131 booleanOperation: FileFormat.BooleanOperation.NA,
132 edited: false,
133 ...path,
134 isFixedToViewport: false,
135 pointRadiusBehaviour: FileFormat.PointsRadiusBehaviour.Rounded,
136 exportOptions: {
137 _class: 'exportOptions',
138 exportFormats: [],
139 includedLayerIds: [],
140 layerOptions: 0,
141 shouldTrim: false,
142 },
143});
144
145export const makeRectShapeLayer = (
146 x: number,

Callers 4

makeLayerFromPathElementFunction · 0.90
shapeLayers.tsFile · 0.90
makeVerticalBorderFunction · 0.85
makeHorizontalBorderFunction · 0.85

Calls 2

generateIDFunction · 0.90
makeResizeConstraintFunction · 0.90

Tested by

no test coverage detected