summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
0cb9829)
pickRect = s.getBounds2D();
Shape es = ElementUtils.getElementShapeOrBounds(e);
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);
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;
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;