public void drawRectOut(Rect rect) {
   int stroke = (int) ((BasicStroke) g2d.getStroke()).getLineWidth();
   Rect r = rect.newDilate(stroke).newWithin(Rect.newPtDim(0, 0, W, H));
   drawRect(r);
 }
 public void drawRect(Rect rect) {
   g2d.drawRect(rect.fromX, rect.fromY, rect.getWidth(), rect.getHeight());
 }