// m = cols, n = rows static L<Rect> tileRects(int w, int h, int m, int n) { new L<Rect> tiles; for y to n: { int y1 = y*h/n, y2 = (y+1)*h/n; for x to m: { int x1 = x*w/m, x2 = (x+1)*w/m; Rect r = rectFromPoints(x1, y1, x2, y2); tiles.add(r); } } ret tiles; }
Began life as a copy of #1016032
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016661 |
Snippet name: | tileRects |
Eternal ID of this version: | #1016661/1 |
Text MD5: | d688a589d6c47a108adea4ad3a261509 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-27 00:51:29 |
Source code size: | 309 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 327 / 360 |
Referenced in: | [show references] |