strokeRect method
Stroke a rectangle (x
,y
, width
x height
).
Implementation
@override
void strokeRect(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 box = PRectangle(x, y, width, height);
var r = clip.intersection(box);
if (r.isZeroDimension) return;
x = r.x;
y = r.y;
width = r.width;
height = r.height;
}
if (width <= 0 || height <= 0) return;
var color = style.color ?? PColor.colorGrey;
var size = style.size ?? 1;
var x1 = x.toInt();
var y1 = y.toInt();
var x2 = x1 + width.toInt();
var y2 = y1 + height.toInt();
_strokeRect(_bitmap, x1, y1, x2, y2, color.imageColor, thickness: size);
}