##// END OF EJS Templates
Bugfixes for unnesery geometry changes
Michal Klocek -
r869:21fb1e963c66
parent child
Show More
@@ -247,6 +247,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain)
247 247 }
248 248
249 249 case QSeries::SeriesTypeScatter: {
250
250 251 QScatterSeries *scatterSeries = static_cast<QScatterSeries *>(series);
251 252 ScatterChartItem *scatter = new ScatterChartItem(scatterSeries,this);
252 253 if(m_options.testFlag(QChart::SeriesAnimations)) {
@@ -343,7 +344,6 void ChartPresenter::setAnimationOptions(QChart::AnimationOptions options)
343 344
344 345 if(m_options!=QChart::NoAnimation && !m_animator) {
345 346 m_animator= new ChartAnimator(this);
346
347 347 }
348 348 resetAllElements();
349 349 }
@@ -504,9 +504,13 void ChartPresenter::updateLayout()
504 504 m_backgroundItem->setRect(m_rect.adjusted(m_marginTiny,m_marginTiny, -m_marginTiny, -m_marginTiny));
505 505 }
506 506
507 m_chartRect = m_rect.adjusted(m_chartMargins.left(),m_chartMargins.top(),-m_chartMargins.right(),-m_chartMargins.bottom());
507 QRectF chartRect = m_rect.adjusted(m_chartMargins.left(),m_chartMargins.top(),-m_chartMargins.right(),-m_chartMargins.bottom());
508
509 if(m_chartRect!=chartRect){
510 m_chartRect=chartRect;
511 emit geometryChanged(m_chartRect);
512 }
508 513
509 emit geometryChanged(m_chartRect);
510 514 legend->setGeometry(m_rect.adjusted(m_legendMargins.left(),m_legendMargins.top(),-m_legendMargins.right(),-m_legendMargins.bottom()));
511 515 }
512 516
@@ -107,7 +107,7 void ScatterChartItem::setLayout(QVector<QPointF>& points)
107 107 return;
108 108 }
109 109
110 int diff = XYChartItem::points().size() - points.size();
110 int diff = m_items.childItems().size() - points.size();
111 111
112 112 if(diff>0) {
113 113 deletePoints(diff);
General Comments 0
You need to be logged in to leave comments. Login now