compressLegacySegments

See source code

Compress legacy draw shape segments by converting VecModel[] points to base64 format. This function is useful for converting old draw shape data to the new compressed format.

function compressLegacySegments(
  segments: {
    points: VecModel[]
    type: 'free' | 'straight'
  }[]
): TLDrawShapeSegment[]

Parameters

NameDescription

segments

{
  points: VecModel[]
  type: 'free' | 'straight'
}[]

Returns

Prev
useUnlockedSelectedShapesCount
Next
createAssetValidator