Changeset 8329:13ea2275cd8a in orange


Ignore:
Timestamp:
06/22/11 12:40:42 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
7bf6d28441c64e7625983dbc0ea8b5852c40fe7a
Message:

Correctly calculate positions for continuous curves

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orangegraph/curve.cpp

    r8327 r8329  
    114114    pen.setWidth(m_pointSize); 
    115115    m_lineItem->setPen(pen); 
     116    m_line = QPainterPath(); 
     117    m_line.moveTo(QPointF(m_data[0].x, m_data[0].y) * m_graphTransform); 
     118    int n = m_data.size(); 
     119    QPointF p; 
     120    qDebug() << "Creating a continuous curve with" << n << "data points"; 
     121    for (int i = 1; i < n; ++i) 
     122    { 
     123      p = QPointF(m_data[i].x, m_data[i].y); 
     124      m_line.lineTo(m_graphTransform.map(p)); 
     125    } 
     126    m_lineItem->setPath(m_line); 
    116127  }  
    117128  else  
     
    336347      m_lineItem = new QGraphicsPathItem(this); 
    337348    } 
    338     m_line = QPainterPath(); 
    339     m_line.moveTo(m_data[0].x, m_data[0].y); 
    340     int n = m_data.size(); 
    341     QPointF p; 
    342     for (int i = 1; i < n; ++i) 
    343     { 
    344       p = QPointF(m_data[i].x, m_data[i].y); 
    345       m_line.lineTo(m_graphTransform.map(p)); 
    346     } 
    347     m_lineItem->setPath(m_line); 
    348349  } else { 
    349350    m_line = QPainterPath(); 
Note: See TracChangeset for help on using the changeset viewer.