diff options
Diffstat (limited to 'src/particles')
-rw-r--r-- | src/particles/qquickellipseextruder.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/particles/qquickellipseextruder.cpp b/src/particles/qquickellipseextruder.cpp index f4374d801..6016d5966 100644 --- a/src/particles/qquickellipseextruder.cpp +++ b/src/particles/qquickellipseextruder.cpp @@ -82,7 +82,13 @@ QPointF QQuickEllipseExtruder::extrude(const QRectF & r) bool QQuickEllipseExtruder::contains(const QRectF &bounds, const QPointF &point) { - return bounds.contains(point);//TODO: Ellipse + if (!bounds.contains(point)) + return false; + + QPointF relPoint(bounds.center() - point); + qreal xa = relPoint.x()/bounds.width(); + qreal yb = relPoint.y()/bounds.height(); + return (xa * xa + yb * yb) < 0.25; } QT_END_NAMESPACE |