1 | static L<Rect> makeGridOfRects(int w, int h, int rw, int rh) { |
2 | ret makeGridOfRects(Rect(0, 0, w, h), rw, rh); |
3 | } |
4 | |
5 | static L<Rect> makeGridOfRects(Rect r, int rw, int rh) { |
6 | new L<Rect> l; |
7 | int w = r.w-mod(r.w, rw); |
8 | int h = r.h-mod(r.h, rh); |
9 | for (int y = r.y; y < h; y += rh) |
10 | for (int x = r.x; x < w; x += rw) |
11 | l.add(Rect(x, y, rw, rh)); |
12 | ret l; |
13 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1015502 |
Snippet name: | makeGridOfRects - does not include partial rects. takes rw and rh, returns L<Rect> |
Eternal ID of this version: | #1015502/3 |
Text MD5: | 07bb041b63b96f7edf2a65563586b30b |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-22 23:35:42 |
Source code size: | 374 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 324 / 361 |
Version history: | 2 change(s) |
Referenced in: | [show references] |