From aeaeae212ae91e60dc0e7a8c5043c6c1ee4da736 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 22 Sep 2011 18:38:42 +1000 Subject: [PATCH] Fix documentation Had x in the y docs, and the pointX/Y weren't relative as the docs had stated. Change-Id: I709f3a30dc527d22abc2ab3987bea359c0e66214 Reviewed-on: http://codereview.qt-project.org/5376 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones --- src/declarative/particles/qsgpointattractor.cpp | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/declarative/particles/qsgpointattractor.cpp b/src/declarative/particles/qsgpointattractor.cpp index 8c2632f..093e55b 100644 --- a/src/declarative/particles/qsgpointattractor.cpp +++ b/src/declarative/particles/qsgpointattractor.cpp @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE Note that Attractor has the standard Item x,y,width and height properties. Like other affectors, these represent the affected area. They do not represent the 0x0 point which is the target of the attraction. - */ @@ -69,8 +68,8 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty real QtQuick.Particles2::PointAttractor::pointY - The x coordinate of the attracting point. This is relative - to the x coordinate of the Attractor. + The y coordinate of the attracting point. This is relative + to the y coordinate of the Attractor. */ /*! \qmlproperty real QtQuick.Particles2::PointAttractor::strength @@ -116,8 +115,8 @@ bool QSGAttractorAffector::affectParticle(QSGParticleData *d, qreal dt) { if (m_strength == 0.0) return false; - qreal dx = m_x - d->curX(); - qreal dy = m_y - d->curY(); + qreal dx = m_x+m_offset.x() - d->curX(); + qreal dy = m_y+m_offset.y() - d->curY(); qreal r = sqrt((dx*dx) + (dy*dy)); qreal theta = atan2(dy,dx); qreal ds = 0; -- 1.7.2.5