Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1015523 // limitPtToRect

JavaX fragment (include)

static Pt limitPtToRect(Pt p, Rect r) {
  if (p == null) null;
  if (r == null) ret p;
  ret Pt(
    max(r.x, min(r.x2(), p.x)),
    max(r.y, min(r.y2(), p.y)));
}

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: 288 / 324
Referenced in: [show references]