writeSize method

void writeSize(
  1. VectorGraphicsBuffer buffer,
  2. double width,
  3. double height
)

Encode the dimensions of the vector graphic.

This should be the first attribute encoded.

Implementation

void writeSize(
  VectorGraphicsBuffer buffer,
  double width,
  double height,
) {
  if (buffer._decodePhase.index != _CurrentSection.size.index) {
    throw StateError('Size already written');
  }
  buffer._decodePhase = _CurrentSection.images;
  buffer._putUint8(_sizeTag);
  buffer._putFloat32(width);
  buffer._putFloat32(height);
}