##// END OF EJS Templates
Fix precision issue when scrolling domain
Michal Klocek -
r1267:e23f2bdfce30
parent child
Show More
@@ -268,7 +268,7 Domain* ChartDataSet::domain(QAxis* axis) const
268 }
268 }
269 }
269 }
270
270
271 void ChartDataSet::scrollDomain(int dx,int dy,const QSizeF& size)
271 void ChartDataSet::scrollDomain(qreal dx,qreal dy,const QSizeF& size)
272 {
272 {
273 QMapIterator<QAxis*, Domain*> i( m_axisDomainMap);
273 QMapIterator<QAxis*, Domain*> i( m_axisDomainMap);
274 //main domain has to be the last one;
274 //main domain has to be the last one;
@@ -53,7 +53,7 public:
53
53
54 void zoomInDomain(const QRectF& rect, const QSizeF& size);
54 void zoomInDomain(const QRectF& rect, const QSizeF& size);
55 void zoomOutDomain(const QRectF& rect, const QSizeF& size);
55 void zoomOutDomain(const QRectF& rect, const QSizeF& size);
56 void scrollDomain(int dx,int dy,const QSizeF& size);
56 void scrollDomain(qreal dx,qreal dy,const QSizeF& size);
57
57
58 int seriesCount(QAbstractSeries::SeriesType type);
58 int seriesCount(QAbstractSeries::SeriesType type);
59 int seriesIndex(QAbstractSeries *series);
59 int seriesIndex(QAbstractSeries *series);
@@ -280,9 +280,8 void ChartPresenter::zoomOut(qreal factor)
280 m_state = ShowState;
280 m_state = ShowState;
281 }
281 }
282
282
283 void ChartPresenter::scroll(int dx,int dy)
283 void ChartPresenter::scroll(qreal dx,qreal dy)
284 {
284 {
285
286 if(dx<0) m_state=ScrollLeftState;
285 if(dx<0) m_state=ScrollLeftState;
287 if(dx>0) m_state=ScrollRightState;
286 if(dx>0) m_state=ScrollRightState;
288 if(dy<0) m_state=ScrollUpState;
287 if(dy<0) m_state=ScrollUpState;
@@ -81,7 +81,7 public:
81 void zoomIn(qreal factor);
81 void zoomIn(qreal factor);
82 void zoomIn(const QRectF& rect);
82 void zoomIn(const QRectF& rect);
83 void zoomOut(qreal factor);
83 void zoomOut(qreal factor);
84 void scroll(int dx,int dy);
84 void scroll(qreal dx,qreal dy);
85
85
86 void setGeometry(const QRectF& rect);
86 void setGeometry(const QRectF& rect);
87 QRectF chartGeometry() const { return m_chartRect; }
87 QRectF chartGeometry() const { return m_chartRect; }
@@ -197,7 +197,7 void Domain::zoomOut(const QRectF& rect, const QSizeF& size)
197 setRange(minX,maxX,minY,maxY,tickXCount,tickYCount);
197 setRange(minX,maxX,minY,maxY,tickXCount,tickYCount);
198 }
198 }
199
199
200 void Domain::move(int dx,int dy,const QSizeF& size)
200 void Domain::move(qreal dx,qreal dy,const QSizeF& size)
201 {
201 {
202 qreal x = spanX() / size.width();
202 qreal x = spanX() / size.width();
203 qreal y = spanY() / size.height();
203 qreal y = spanY() / size.height();
@@ -62,7 +62,7 public:
62
62
63 void zoomIn(const QRectF& rect, const QSizeF& size);
63 void zoomIn(const QRectF& rect, const QSizeF& size);
64 void zoomOut(const QRectF& rect, const QSizeF& size);
64 void zoomOut(const QRectF& rect, const QSizeF& size);
65 void move(int dx,int dy,const QSizeF& size);
65 void move(qreal dx,qreal dy,const QSizeF& size);
66
66
67 Q_SIGNALS:
67 Q_SIGNALS:
68 void domainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY);
68 void domainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY);
General Comments 0
You need to be logged in to leave comments. Login now