Skip to content

Commit

Permalink
Fixed port offset interpretation
Browse files Browse the repository at this point in the history
  • Loading branch information
Uko committed Apr 7, 2012
1 parent dc6db64 commit 6e6142c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,18 @@ public void attachPortWidget(ElementPortWidget widget)
case "right":
widget.setPreferredLocation(new Point(width,
//offset from the middle, offset in "percents" of the height half
(int) (height*0.5*(1+0.5*elNode.getPortOffset(widget.getPort()).doubleValue()))));
(int) (height*(1+elNode.getPortOffset(widget.getPort()).doubleValue())/2)));
break;
case "left":
widget.setPreferredLocation(new Point(0,
//offset from the middle, offset in "percents" of the height half
(int) (height*0.5*(1+0.5*elNode.getPortOffset(widget.getPort()).doubleValue()))));
(int) (height*(1+elNode.getPortOffset(widget.getPort()).doubleValue())/2)));
break;
case "up":
widget.setPreferredLocation(new Point((int) (width*(1+elNode.getPortOffset(widget.getPort()).doubleValue())/2),height));
break;
case "down":
widget.setPreferredLocation(new Point((int) (width*(1+elNode.getPortOffset(widget.getPort()).doubleValue())/2),0));
break;
}
}
Expand Down

0 comments on commit 6e6142c

Please sign in to comment.