strokeRect method
Stroke a rectangle (x
,y
, width
x height
).
Implementation
@override
void strokeRect(num x, num y, num width, num height, PStyle style) {
if (width == 1 || height == 1) {
fillRect(x, y, width, height, style);
return;
}
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;
final size = _setStrokeStyle(style);
if (size % 2 != 0) {
x += 0.5;
y += 0.5;
--width;
--height;
}
//_ctx.strokeRect(x + 0.5, y + 0.5, width - 1, height - 1);
_ctx.strokeRect(x, y, width, height);
}