fastRect function

void fastRect(
  1. Painter p,
  2. double x,
  3. double y,
  4. double w,
  5. double h,
  6. int c,
)

Implementation

void fastRect(Painter p, double x, double y, double w, double h, int c) {
  if (!_unrotated(p)) {
    p.rect(x, y, w, h, c);
    return;
  }
  final x0 = x.round();
  final x1 = (x + w).round();
  final y0 = y.round();
  final y1 = (y + h).round();
  final fx = p.fx;
  final b = _col0(p);
  for (var yy = y0; yy < y1; yy++) {
    final sy = (p.ty + yy + 0.5).floor();
    for (var xx = x0; xx < x1; xx++) {
      p.put(b + fx * xx, sy, c, 1.0);
    }
  }
}