Skip to content

makePathSimpler

makePathSimpler(path): TSimplePathData

Defined in: src/util/path/index.ts:351

This function takes a parsed SVG path and makes it simpler for fabricJS logic. Simplification consist of:

  • All commands converted to absolute (lowercase to uppercase)
  • S converted to C
  • T converted to Q
  • A converted to C

Parameters

path

TComplexPathData

the array of commands of a parsed SVG path for Path

Returns

TSimplePathData

the simplified array of commands of a parsed SVG path for Path TODO: figure out how to remove the type assertions in a nice way