compressLegacySegments

See source code

Compress legacy draw shape segments by converting VecModel[] points to delta-encoded base64 format. This function is useful for converting old draw shape data to the new compressed format. Uses delta encoding for improved Float16 precision.

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

Parameters

NameDescription

segments

{
  points: VecModel[];
  type: "free" | "straight";
}[];

Returns

Prev
useUnlockedSelectedShapesCount
Next
createAssetValidator