pickRect = s.getBounds2D();
Shape es = ElementUtils.getElementShapeOrBounds(e);
+ // getElementShapeOrBounds returns shape or bounds in local coords!
+ es = ElementUtils.getTransform(e).createTransformedShape(es);
PathIterator iter = es.getPathIterator(null);
Collection<double[]> segments = new ArrayList<double[]>();
PathUtils.toLineSegments(iter, segments);
for (double[] seg : segments) {
if (pickRect.intersectsLine(seg[0], seg[1], seg[2], seg[3]))
return true;
+ if (pickRect.contains(seg[0], seg[1]))
+ return true;
+ if (pickRect.contains(seg[2], seg[3]))
+ return true;
}
+
return false;
}