static Rect rectUnion(Rect a, Rect b) { if (a == null) ret b; if (b == null) ret a; int x = min(a.x, b.x), y = min(a.y, b.y); int x2 = max(a.x+a.w, b.x+b.w), y2 = max(a.y+a.h, b.y+b.h); ret new Rect(x, y, x2-x, y2-y); }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005838 |
Snippet name: | rectUnion |
Eternal ID of this version: | #1005838/1 |
Text MD5: | d78985b40942194fa7c430184688369f |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-20 23:41:35 |
Source code size: | 235 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 581 / 595 |
Referenced in: | #1006162 - intersectRects #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1033586 - rectUnionWithPt |