Tolerance was incorrectly subtracted instead of added in RouteLine
picking. RouteGraphConnectionClass did not take selection stroke width
into account when doing coarse picking based on bounding box.
gitlab #396
Change-Id: I6dabe7297eb553f0894c4299c393bb5369b45866
public boolean isNear(double x2, double y2, double tolerance) {
return isHorizontal
? Math.abs(y2-position) <= tolerance
- && points.get(0).x <= x2 - tolerance
+ && points.get(0).x - tolerance <= x2
&& x2 <= points.get(points.size()-1).x + tolerance
: Math.abs(x2-position) <= tolerance
- && points.get(0).y <= y2 - tolerance
+ && points.get(0).y - tolerance <= y2
&& y2 <= points.get(points.size()-1).y + tolerance;
}
@Override
public Rectangle2D getBounds(IElement e, Rectangle2D size) {
- RouteGraph rg = getRouteGraph(e);
- if (rg != null) {
+ RouteGraphNode rgn = e.getHint(KEY_RG_NODE);
+ if (rgn != null) {
if (size == null)
size = new Rectangle2D.Double();
- rg.getBounds(size);
+ size.setRect(rgn.getBoundsInLocal());
}
return size;
}