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

12
LINES

< > BotCompany Repo | #1015607 // drawArrowBetweenRects

JavaX fragment (include)

1  
static void drawArrowBetweenRects(Graphics2D g, Rect r1, Rect r2, Color color) {
2  
  // TODO: more cases
3  
  Pt p1, p2;
4  
  if (r2.x > r1.x2()) {
5  
    p1 = pt(r1.x2(), middleOfY(r1));
6  
    p2 = pt(r2.x-1, middleOfY(r2));
7  
  } else {
8  
    p1 = pt(middleOfX(r1), r1.y-1);
9  
    p2 = pt(middleOfX(r2), r2.y+r2.h);
10  
  }
11  
  drawArrowBetweenPoints(g, p1, p2, color);
12  
}

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: 302 / 346
Version history: 14 change(s)
Referenced in: [show references]