Browse Source

Merge pull request #13468 from jagannatharjun/graph-full

Correctly fill whole width of graph
adaptive-webui-19844
Mike Tzou 4 years ago committed by GitHub
parent
commit
8df53e9370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/gui/properties/speedplotview.cpp

6
src/gui/properties/speedplotview.cpp

@ -271,7 +271,7 @@ quint64 SpeedPlotView::maxYValue()
if (!m_properties[static_cast<GraphID>(id)].enable) if (!m_properties[static_cast<GraphID>(id)].enable)
continue; continue;
for (int i = static_cast<int>(queue.size()) - 1, j = 0; (i >= 0) && (j <= m_viewablePointsCount); --i, ++j) for (int i = static_cast<int>(queue.size()) - 1, j = 0; (i >= 0) && (j < m_viewablePointsCount); --i, ++j)
if (queue[i].y[id] > maxYValue) if (queue[i].y[id] > maxYValue)
maxYValue = queue[i].y[id]; maxYValue = queue[i].y[id];
} }
@ -345,7 +345,7 @@ void SpeedPlotView::paintEvent(QPaintEvent *)
rect.adjust(3, 0, 0, 0); // Need, else graphs cross left gridline rect.adjust(3, 0, 0, 0); // Need, else graphs cross left gridline
const double yMultiplier = (niceScale.arg == 0.0) ? 0.0 : (static_cast<double>(rect.height()) / niceScale.sizeInBytes()); const double yMultiplier = (niceScale.arg == 0.0) ? 0.0 : (static_cast<double>(rect.height()) / niceScale.sizeInBytes());
const double xTickSize = static_cast<double>(rect.width()) / m_viewablePointsCount; const double xTickSize = static_cast<double>(rect.width()) / (m_viewablePointsCount - 1);
boost::circular_buffer<PointData> &queue = getCurrentData(); boost::circular_buffer<PointData> &queue = getCurrentData();
@ -354,7 +354,7 @@ void SpeedPlotView::paintEvent(QPaintEvent *)
continue; continue;
QVector<QPoint> points; QVector<QPoint> points;
for (int i = static_cast<int>(queue.size()) - 1, j = 0; (i >= 0) && (j <= m_viewablePointsCount); --i, ++j) { for (int i = static_cast<int>(queue.size()) - 1, j = 0; (i >= 0) && (j < m_viewablePointsCount); --i, ++j) {
int newX = rect.right() - j * xTickSize; int newX = rect.right() - j * xTickSize;
int newY = rect.bottom() - queue[i].y[id] * yMultiplier; int newY = rect.bottom() - queue[i].y[id] * yMultiplier;

Loading…
Cancel
Save