ganeswidgets/src/hgspring.cpp
changeset 12 6c0ec0ccd2d4
parent 11 42505cd701c6
child 17 a10844a9914d
equal deleted inserted replaced
11:42505cd701c6 12:6c0ec0ccd2d4
    69 }
    69 }
    70 
    70 
    71 // TODO: Remove this function and use only the animateToPosAfterPanning version?
    71 // TODO: Remove this function and use only the animateToPosAfterPanning version?
    72 void HgSpring::animateToPos(const QPointF& pos)
    72 void HgSpring::animateToPos(const QPointF& pos)
    73 {    
    73 {    
       
    74     if (mPos == pos) {
       
    75         // No need to animate, we are already in correct position.
       
    76         return;
       
    77     }
       
    78             
    74     mStartPos = mPos;
    79     mStartPos = mPos;
    75     mEndPos = pos;
    80     mEndPos = pos;
    76 
    81 
    77     emit started();
    82     emit started();
    78 
    83