addRect method
Implementation
void addRect(AABB r, Mat2D xform, PathDirection dir) {
final p0 = xform * Vec2D.fromValues(r.left, r.top);
final p1 = xform * Vec2D.fromValues(r.right, r.top);
final p2 = xform * Vec2D.fromValues(r.right, r.bottom);
final p3 = xform * Vec2D.fromValues(r.left, r.bottom);
move(p0);
if (dir == PathDirection.clockwise) {
line(p1);
line(p2);
line(p3);
} else {
assert(dir == PathDirection.counterclockwise);
line(p3);
line(p2);
line(p1);
}
close();
}