static ItIt allSubRectsOfSizeIterator(int w, int h, Rect full) { if (full == null) ret emptyItIt(); int fullW = full.w, fullH = full.h; if (w > fullW || h > fullH) ret emptyItIt(); int freeplayX = fullW-w+1, freeplayY = fullH-h+1, freeplay = freeplayX*freeplayY; ret mapI(iota_zero(freeplay), i -> rect(full.x + (i % freeplayX), full.y + (i / freeplayX), w, h)); }