MCPcopy Create free account
hub / github.com/Stanko/offset-polygon / offsetPolygon

Function offsetPolygon

docs/src/offset-polygon.js:156–163  ·  view source on GitHub ↗
(vertices, offset, arcSegments = 0)

Source from the content-addressed store, hash-verified

154 return paddingPolygon;
155}
156export default function offsetPolygon(vertices, offset, arcSegments = 0) {
157 const polygon = createPolygon(vertices);
158 if (offset > 0) {
159 return createMarginPolygon(polygon, offset, arcSegments).vertices;
160 } else {
161 return createPaddingPolygon(polygon, -offset, arcSegments).vertices;
162 }
163}

Callers 6

initFunction · 0.50
onDragFunction · 0.50
onPaddingChangeFunction · 0.50
onMarginChangeFunction · 0.50

Calls 3

createPolygonFunction · 0.70
createMarginPolygonFunction · 0.70
createPaddingPolygonFunction · 0.70

Tested by

no test coverage detected