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

6
LINES

< > BotCompany Repo | #1018812 // rescaleRect

JavaX fragment (include)

static Rect rescaleRect(Rect r, int w1, int h1, int w2, int h2) {
  if (r == null) null;
  double x = doubleRatio(w2, w1), y = doubleRatio(h2, h1);
  ret rectFromPoints(iround(r.x*x), iround(r.y*y),
    iround(r.x2()*x), iround(r.y2()*y));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018812
Snippet name: rescaleRect
Eternal ID of this version: #1018812/3
Text MD5: 9b5dcbf4605ea943f1daccbf9e84474c
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-27 14:09:17
Source code size: 246 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 478 / 522
Version history: 2 change(s)
Referenced in: [show references]