fillRect method

  1. @override
void fillRect(
  1. num x,
  2. num y,
  3. num width,
  4. num height,
  5. PStyle style,
)
override

Fill a rectangle (x,y , width x height).

Implementation

@override
void fillRect(num x, num y, num width, num height, PStyle style) {
  x = transform.x(x);
  y = transform.y(y);

  x = canvasX(x);
  y = canvasY(y);
  width = canvasX(width);
  height = canvasY(height);

  if (width <= 0 || height <= 0) return;

  _setFillStyle(style);

  _ctx.fillRect(x, y, width, height);
}