Changeset 8207:8ff57a2fd423 in orange


Ignore:
Timestamp:
08/18/11 09:10:45 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
2cdf0a9c096c0df8d0523a752470cb01ecc7624e
Message:

Disable animations for new points

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orangeqt/curve.cpp

    r8178 r8207  
    441441    for (int i = 0; i < n; ++i) 
    442442    { 
    443         QPropertyAnimation* a = new QPropertyAnimation(m_pointItems[i], "pos", m_pointItems[i]); 
    444         a->setEndValue(m_pos_watcher.resultAt(i)); 
    445         group->addAnimation(a); 
     443        /*  
     444         * If a point was just created, its position is (0,0) 
     445         * In this case, animating it would create more confusion that good 
     446         * So we just move it without an animation.  
     447         * This is the case (for example) for the anchor curve in RadViz 
     448         */ 
     449        if (m_pointItems[i]->pos().isNull()) 
     450        { 
     451            m_pointItems[i]->setPos(m_pos_watcher.resultAt(i)); 
     452        } 
     453        else 
     454        { 
     455            QPropertyAnimation* a = new QPropertyAnimation(m_pointItems[i], "pos", m_pointItems[i]); 
     456            a->setEndValue(m_pos_watcher.resultAt(i)); 
     457            group->addAnimation(a); 
     458        } 
    446459    } 
    447460    group->start(QAbstractAnimation::DeleteWhenStopped); 
Note: See TracChangeset for help on using the changeset viewer.