@Override // from RectangularShape public boolean contains (float rx, float ry, float rw, float rh) { if (!(contains(rx, ry) && contains(rx + rw, ry) && contains(rx + rw, ry + rh) && contains(rx, ry + rh))) { return false; } float absExtent = Math.abs(angleExtent()); if (arcType() != PIE || absExtent <= 180f || absExtent >= 360f) { return true; } Rectangle r = new Rectangle(rx, ry, rw, rh); float cx = centerX(), cy = centerY(); if (r.contains(cx, cy)) { return false; } Point p1 = startPoint(), p2 = endPoint(); return !r.intersectsLine(cx, cy, p1.x(), p1.y()) && !r.intersectsLine(cx, cy, p2.x(), p2.y()); }
@Override // from RectangularShape public boolean contains (float rx, float ry, float rw, float rh) { if (!(contains(rx, ry) && contains(rx + rw, ry) && contains(rx + rw, ry + rh) && contains(rx, ry + rh))) { return false; } float absExtent = Math.abs(angleExtent()); if (arcType() != PIE || absExtent <= 180f || absExtent >= 360f) { return true; } Rectangle r = new Rectangle(rx, ry, rw, rh); float cx = centerX(), cy = centerY(); if (r.contains(cx, cy)) { return false; } Point p1 = startPoint(), p2 = endPoint(); return !r.intersectsLine(cx, cy, p1.x(), p1.y()) && !r.intersectsLine(cx, cy, p2.x(), p2.y()); }
if (r.intersectsLine(p1.x(), p1.y(), cx, cy) || r.intersectsLine(p2.x(), p2.y(), cx, cy)) { return true; if (r.intersectsLine(p1.x(), p1.y(), p2.x(), p2.y())) { return true;
if (r.intersectsLine(p1.x(), p1.y(), cx, cy) || r.intersectsLine(p2.x(), p2.y(), cx, cy)) { return true; if (r.intersectsLine(p1.x(), p1.y(), p2.x(), p2.y())) { return true;