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

11
LINES

< > BotCompany Repo | #1032240 // containsPt

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (223L/2K).

sbool containsPt(int x1, int y1, int w, int h, Pt p) {
  ret p.x >= x1 && p.y >= y1 && p.x < x1+w && p.y < y1+h;
}

sbool containsPt(Rect a, int x, int y) {
  ret a != null && a.contains(x, y);
}

sbool containsPt(Rect a, Pt p) {
  ret a != null && p != null && a.contains(p.x, p.y);
}

Author comment

Began life as a copy of #1006664

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032240
Snippet name: containsPt
Eternal ID of this version: #1032240/3
Text MD5: 6829773bef463741e7bc5c346baef797
Transpilation MD5: f4721a267a03196904339667e84dc053
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-21 04:51:09
Source code size: 295 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 99 / 151
Version history: 2 change(s)
Referenced in: [show references]