1 | static Pt limitPtToRect(Pt p, Rect r) { |
2 | if (p == null) null; |
3 | if (r == null) ret p; |
4 | ret Pt( |
5 | max(r.x, min(r.x2(), p.x)), |
6 | max(r.y, min(r.y2(), p.y))); |
7 | } |
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: | #1015523 |
Snippet name: | limitPtToRect |
Eternal ID of this version: | #1015523/1 |
Text MD5: | 6a52b2ef80eaac90d4fb73a1771b9035 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-15 12:58:32 |
Source code size: | 169 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 367 / 402 |
Referenced in: | [show references] |