MCPcopy
hub / github.com/Yqnn/svg-path-editor / insert

Method insert

src/lib/svg.ts:597–605  ·  view source on GitHub ↗
(item: SvgItem, after?: SvgItem)

Source from the content-addressed store, hash-verified

595 }
596
597 insert(item: SvgItem, after?: SvgItem) {
598 const idx = after ? this.path.indexOf(after) : -1;
599 if (idx !== -1) {
600 this.path.splice(idx + 1, 0, item);
601 } else {
602 this.path.push(item);
603 }
604 this.refreshAbsolutePositions();
605 }
606
607 changeType(item: SvgItem, newType: SvgCommandTypeAny): SvgItem | null {
608 const idx = this.path.indexOf(item);

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected