scaleAbout method

void scaleAbout(
  1. double cx,
  2. double cy,
  3. double scale
)

Implementation

void scaleAbout(double cx, double cy, double scale) {
  if (scale == 1) {
    return;
  }
  for (var i = 0; i < _length; i++) {
    final base = i * stride;
    _data[base + _ox] = cx + (_data[base + _ox] - cx) * scale;
    _data[base + _oy] = cy + (_data[base + _oy] - cy) * scale;
    _data[base + _or] *= scale;
  }
  for (var i = 0; i < _lineCount; i++) {
    final base = i * lineStride;
    _lines[base] = cx + (_lines[base] - cx) * scale;
    _lines[base + 1] = cy + (_lines[base + 1] - cy) * scale;
    _lines[base + 2] = cx + (_lines[base + 2] - cx) * scale;
    _lines[base + 3] = cy + (_lines[base + 3] - cy) * scale;
    _lines[base + 6] *= scale;
  }
}