33QPointF QQuickEllipseExtruder::extrude(
const QRectF & r)
35 qreal theta = QRandomGenerator::global()->bounded(2 *
M_PI);
36 qreal mag = m_fill ? QRandomGenerator::global()->generateDouble() : 1;
37 return QPointF(r.x() + r.width()/2 + mag * (r.width()/2) * qCos(theta),
38 r.y() + r.height()/2 + mag * (r.height()/2) * qSin(theta));
41bool QQuickEllipseExtruder::contains(
const QRectF &bounds,
const QPointF &point)
43 if (!bounds.contains(point))
46 QPointF relPoint(bounds.center() - point);
47 qreal xa = relPoint.x()/bounds.width();
48 qreal yb = relPoint.y()/bounds.height();
49 return (xa * xa + yb * yb) < 0.25;