SPath.rect constructor
A rectangle shape
Implementation
SPath.rect(
{required Point<double> at, required Size size, bool centered = false}) {
if (centered) {
final dX = size.width / 2;
final dY = size.height / 2;
currentPoint = at + Point(-dX, -dY);
line(to: at + Point(dX, -dY));
line(to: at + Point(dX, dY));
line(to: at + Point(-dX, dY));
close();
} else {
currentPoint = at;
line(to: at + Point(size.width, 0));
line(to: at + Point(size.width, size.height));
line(to: at + Point(0, size.height));
close();
}
}