From: José Fonseca Date: Sun, 9 Dec 2012 12:38:48 +0000 (+0000) Subject: qapitrace: Fix histogram tooltip for profiles with small number of calls. X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=857c292110606679d2ba7de05d2782b5a36a5542 qapitrace: Fix histogram tooltip for profiles with small number of calls. --- diff --git a/gui/graphing/histogramview.cpp b/gui/graphing/histogramview.cpp index 0b94577..2dd3d8e 100644 --- a/gui/graphing/histogramview.cpp +++ b/gui/graphing/histogramview.cpp @@ -228,8 +228,8 @@ void HistogramView::paintEvent(QPaintEvent *) qint64 HistogramView::itemAtPosition(QPoint pos) { double dvdx = m_viewWidth / (double)width(); - qint64 left = qFloor(dvdx) * (pos.x() - 1) + m_viewLeft; - qint64 right = qCeil(dvdx) * (pos.x() + 1) + m_viewLeft; + qint64 left = qFloor(dvdx * (pos.x() - 1)) + m_viewLeft; + qint64 right = qCeil(dvdx * (pos.x() + 1)) + m_viewLeft; qint64 longestIndex = 0; qint64 longestValue = 0;