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

7
LINES

< > BotCompany Repo | #1006030 // rectAround - rectangle centered around a point. arguments given are the final width and height of the rect

JavaX fragment (include)

static Rect rectAround(Pt p, int w, int h default w) {
  ret new Rect(p.x-w/2, p.y-h/2, w, h);
}

static Rect rectAround(int x, int y, int w, int h) {
  ret new Rect(x-w/2, y-h/2, w, h);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006030
Snippet name: rectAround - rectangle centered around a point. arguments given are the final width and height of the rect
Eternal ID of this version: #1006030/4
Text MD5: f73baab3c5d76f5fda568f4717449e33
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-21 04:34:33
Source code size: 194 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 493 / 552
Version history: 3 change(s)
Referenced in: [show references]