Browse files

Fixed port offset interpretation

  • Loading branch information...
1 parent dc6db64 commit 6e6142ccd2dd2dcfd446ce8018394c7b1bbd056d @Uko committed Apr 7, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 VisualEditor/src/net/unikernel/bummel/visual_editor/ElementWidget.java
View
6 VisualEditor/src/net/unikernel/bummel/visual_editor/ElementWidget.java
@@ -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;
}
}

0 comments on commit 6e6142c

Please sign in to comment.