0
0
mirror of https://github.com/yse/easy_profiler.git synced 2025-01-14 16:47:55 +08:00

(ProfGraphicsView) refactoring

This commit is contained in:
Victor Zarubkin 2016-08-07 20:16:15 +03:00
parent cae3ab989e
commit 30f0261bae

View File

@ -537,8 +537,7 @@ void ProfChronometerItem::paint(QPainter* _painter, const QStyleOptionGraphicsIt
m_indicator.clear(); m_indicator.clear();
if (m_left > sceneRight) if (m_left > sceneRight)
{ {
auto vbar = sceneView->verticalScrollBar(); sceneRight = (sceneRight - offset) * currentScale;
sceneRight = ((sceneRight - offset) * currentScale) - 2 - (vbar->isVisible() ? vbar->width() : 0);
m_indicator.push_back(QPointF(sceneRight - 10, vcenter - 10)); m_indicator.push_back(QPointF(sceneRight - 10, vcenter - 10));
m_indicator.push_back(QPointF(sceneRight, vcenter)); m_indicator.push_back(QPointF(sceneRight, vcenter));
m_indicator.push_back(QPointF(sceneRight - 10, vcenter + 10)); m_indicator.push_back(QPointF(sceneRight - 10, vcenter + 10));
@ -1404,9 +1403,9 @@ void ProfGraphicsView::mouseMoveEvent(QMouseEvent* _event)
void ProfGraphicsView::resizeEvent(QResizeEvent* _event) void ProfGraphicsView::resizeEvent(QResizeEvent* _event)
{ {
QGraphicsView::resizeEvent(_event);
updateVisibleSceneRect(); // Update scene visible rect only once updateVisibleSceneRect(); // Update scene visible rect only once
updateScene(); // repaint scene updateScene(); // repaint scene
QGraphicsView::resizeEvent(_event);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////