static L makeGridOfRects(int w, int h, int rw, int rh) { ret makeGridOfRects(Rect(0, 0, w, h), rw, rh); } static L makeGridOfRects(Rect r, int rw, int rh) { new L l; int w = r.w-mod(r.w, rw); int h = r.h-mod(r.h, rh); for (int y = r.y; y < h; y += rh) for (int x = r.x; x < w; x += rw) l.add(Rect(x, y, rw, rh)); ret l; }