ganeswidgets/src/hgspring.cpp
changeset 3 c863538fcbb6
parent 2 49c70dcc3f17
child 5 4fa04caf0f43
equal deleted inserted replaced
2:49c70dcc3f17 3:c863538fcbb6
    81     mEndPos = pos;
    81     mEndPos = pos;
    82 }
    82 }
    83 
    83 
    84 void HgSpring::cancel()
    84 void HgSpring::cancel()
    85 {
    85 {
    86     if (mTimer->isActive())
    86     if (mTimer->isActive()) {
       
    87         mEndPos = mPos;
       
    88         emit ended();
    87         mTimer->stop(); 
    89         mTimer->stop(); 
       
    90     }
    88     
    91     
    89     mVelocity = QPointF(0,0);
       
    90 }
    92 }
    91 
    93 
    92 const QPointF& HgSpring::startPos() const
    94 const QPointF& HgSpring::startPos() const
    93 {
    95 {
    94     return mStartPos;
    96     return mStartPos;
   162         return true;
   164         return true;
   163     }
   165     }
   164     return false;
   166     return false;
   165 }
   167 }
   166 
   168 
       
   169 void HgSpring::resetVelocity()
       
   170 {
       
   171     mVelocity = QPointF(0,0);
       
   172 }
   167 
   173 
   168