@Override // from RectangularShape public Rectangle bounds (Rectangle target) { if (isEmpty()) { target.setBounds(x(), y(), width(), height()); return target; } float rx1 = x(); float ry1 = y(); float rx2 = rx1 + width(); float ry2 = ry1 + height(); Point p1 = startPoint(), p2 = endPoint(); float bx1 = containsAngle(180f) ? rx1 : Math.min(p1.x(), p2.x()); float by1 = containsAngle(90f) ? ry1 : Math.min(p1.y(), p2.y()); float bx2 = containsAngle(0f) ? rx2 : Math.max(p1.x(), p2.x()); float by2 = containsAngle(270f) ? ry2 : Math.max(p1.y(), p2.y()); if (arcType() == PIE) { float cx = centerX(); float cy = centerY(); bx1 = Math.min(bx1, cx); by1 = Math.min(by1, cy); bx2 = Math.max(bx2, cx); by2 = Math.max(by2, cy); } target.setBounds(bx1, by1, bx2 - bx1, by2 - by1); return target; }
@Override // from RectangularShape public Rectangle bounds (Rectangle target) { if (isEmpty()) { target.setBounds(x(), y(), width(), height()); return target; } float rx1 = x(); float ry1 = y(); float rx2 = rx1 + width(); float ry2 = ry1 + height(); Point p1 = startPoint(), p2 = endPoint(); float bx1 = containsAngle(180f) ? rx1 : Math.min(p1.x(), p2.x()); float by1 = containsAngle(90f) ? ry1 : Math.min(p1.y(), p2.y()); float bx2 = containsAngle(0f) ? rx2 : Math.max(p1.x(), p2.x()); float by2 = containsAngle(270f) ? ry2 : Math.max(p1.y(), p2.y()); if (arcType() == PIE) { float cx = centerX(); float cy = centerY(); bx1 = Math.min(bx1, cx); by1 = Math.min(by1, cy); bx2 = Math.max(bx2, cx); by2 = Math.max(by2, cy); } target.setBounds(bx1, by1, bx2 - bx1, by2 - by1); return target; }
if (isEmpty() || rw <= 0f || rh <= 0f) { return false;
if (isEmpty() || rw <= 0f || rh <= 0f) { return false;