clearRect method
Clears a part of the canvas.
- Applies
style
if provided.
Implementation
@override
void clearRect(num x, num y, num width, num height, {PStyle? style}) {
x = transform.x(x);
y = transform.y(y);
var clip = _clip;
if (clip != null) {
var r = clip.intersection(PRectangle(x, y, width, height));
if (r.isZeroDimension) {
return;
}
x = r.x;
y = r.y;
width = r.width;
height = r.height;
}
var color = style?.color ?? PColor.colorWhite;
fillRect(x, y, width, height, PStyle(color: color));
}