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

12
LINES

< > BotCompany Repo | #1015607 // drawArrowBetweenRects

JavaX fragment (include)

static void drawArrowBetweenRects(Graphics2D g, Rect r1, Rect r2, Color color) {
  // TODO: more cases
  Pt p1, p2;
  if (r2.x > r1.x2()) {
    p1 = pt(r1.x2(), middleOfY(r1));
    p2 = pt(r2.x-1, middleOfY(r2));
  } else {
    p1 = pt(middleOfX(r1), r1.y-1);
    p2 = pt(middleOfX(r2), r2.y+r2.h);
  }
  drawArrowBetweenPoints(g, p1, p2, color);
}

Author comment

Began life as a copy of #1007302

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: #1015607
Snippet name: drawArrowBetweenRects
Eternal ID of this version: #1015607/15
Text MD5: f023d7f1dbceb9ae79559445f546adf5
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-19 20:22:38
Source code size: 359 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 300 / 343
Version history: 14 change(s)
Referenced in: [show references]