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   

Travelled to 10 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

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

Formerly at http://tinybrain.de/1015607 & http://1015607.tinybrain.de