Fix documentation
authorAlan Alpert <alan.alpert@nokia.com>
Thu, 22 Sep 2011 08:38:42 +0000 (18:38 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Sep 2011 01:50:16 +0000 (03:50 +0200)
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>

src/declarative/particles/qsgpointattractor.cpp

index 8c2632f..093e55b 100644 (file)
@@ -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;