Changeset 8525:03ef311e4eca in orange


Ignore:
Timestamp:
07/29/11 14:07:21 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
4cd7f952f1a47873c2ac4c56313b321c40e4fe96
Message:

Use a cosmetic pen for lines in NetworkCurve and UnconnectedLinesCurve

Location:
source/orangeplot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • source/orangeplot/networkcurve.cpp

    r8524 r8525  
    147147    QPen p = pen(); 
    148148    p.setWidthF(m_size); 
     149    p.setCosmetic(true); 
    149150    setPen(p); 
    150151    setZValue(0); 
     
    270271    const double scale = 1.0/zoom_factor(); 
    271272    update_items(m_nodes, NodeUpdater(t, scale), UpdatePosition); 
    272     update_items(m_edges, EdgeUpdater(t, scale), UpdatePen); 
     273    update_items(m_edges, EdgeUpdater(t), UpdatePen); 
    273274} 
    274275 
  • source/orangeplot/networkcurve.h

    r8524 r8525  
    124124{ 
    125125public: 
    126     EdgeUpdater(const QTransform& t, double scale) : m_t(t), m_scale(scale) {} 
     126    EdgeUpdater(const QTransform& t) : m_t(t){} 
    127127    void operator()(EdgeItem* item) 
    128128    { 
     
    130130        { 
    131131            item->setLine(QLineF(item->u()->x(), item->u()->y(), item->v()->x(), item->v()->y()) * m_t); 
    132             QPen p = item->pen(); 
    133             p.setWidthF(p.widthF() * m_scale); 
    134             item->setPen(p); 
    135132        } 
    136133    } 
  • source/orangeplot/unconnectedlinescurve.cpp

    r8444 r8525  
    3434    Q_ASSERT(m_items.size() == n); 
    3535    QLineF line; 
     36    QPen p = pen(); 
     37    p.setCosmetic(true); 
    3638    for (int i = 0; i < n; ++i) 
    3739    { 
    3840        line.setLine( d[2*i].x, d[2*i].y, d[2*i+1].x, d[2*i+1].y ); 
    3941        m_items[i]->setLine(graph_transform().map(line)); 
    40         m_items[i]->setPen(pen()); 
     42        m_items[i]->setPen(p); 
    4143    } 
    4244} 
Note: See TracChangeset for help on using the changeset viewer.