Changeset 8584:0050b6fe1a6a in orange


Ignore:
Timestamp:
08/03/11 11:15:46 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
38efd2ff78b90ae1091838d20b9ebaaa93ebb66f
Message:

Slightly speed up updating the UnconnectedLinesCurve

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orangeplot/unconnectedlinescurve.cpp

    r8576 r8584  
    22#include <QtGui/QPen> 
    33#include <QtCore/QDebug> 
     4 
     5const Curve::UpdateFlags UlcUpdateFlags = Curve::UpdateNumberOfItems | Curve::UpdatePosition | Curve::UpdatePen; 
    46 
    57UnconnectedLinesCurve::UnconnectedLinesCurve(const QList< double >& x_data, const QList< double >& y_data, QGraphicsItem* parent, QGraphicsScene* scene): Curve(x_data, y_data, parent, scene) 
     
    1517void UnconnectedLinesCurve::update_properties() 
    1618{ 
    17     if (needs_update() & (UpdateNumberOfItems)) 
     19    if (needs_update() & UlcUpdateFlags) 
    1820    {    
    19         const int n = data().size()/2; 
     21        const Data d = data(); 
     22        const int n = d.size()/2; 
    2023        const int m = m_items.size(); 
    2124        if (m > n) 
     
    3336            } 
    3437        } 
    35         set_updated(UpdateNumberOfItems); 
    3638        Q_ASSERT(m_items.size() == n); 
    37     } 
    38     if (needs_update() & (UpdatePosition | UpdatePen) ) 
    39     { 
    40         const Data d = data(); 
    41         const int n = d.size()/2; 
     39         
    4240        QLineF line; 
    4341        QPen p = pen(); 
     
    4947            m_items[i]->setPen(p); 
    5048        } 
    51         set_updated(UpdatePosition | UpdatePen); 
     49        set_updated(UlcUpdateFlags); 
    5250    } 
    5351} 
Note: See TracChangeset for help on using the changeset viewer.