summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/ruleritem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/ruleritem.cpp')
-rw-r--r--qt-ui/profile/ruleritem.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qt-ui/profile/ruleritem.cpp b/qt-ui/profile/ruleritem.cpp
index 627958e37..768d912e9 100644
--- a/qt-ui/profile/ruleritem.cpp
+++ b/qt-ui/profile/ruleritem.cpp
@@ -42,7 +42,7 @@ void RulerNodeItem2::recalculate()
if (x() < 0) {
setPos(0, y());
} else if (x() > timeAxis->posAtValue(data->sec)) {
- setPos(timeAxis->posAtValue(data->sec), y());
+ setPos(timeAxis->posAtValue(data->sec), depthAxis->posAtValue(data->depth));
} else {
data = pInfo.entry;
count = 0;
@@ -77,6 +77,8 @@ RulerItem2::RulerItem2() : source(new RulerNodeItem2()),
textItem->setFlag(QGraphicsItem::ItemIgnoresTransformations);
textItemBack->setBrush(QColor(0xff, 0xff, 0xff, 190));
textItemBack->setPen(QColor(Qt::white));
+ textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations);
+ setPen(QPen(QColor(Qt::black), 0.0));
}
void RulerItem2::recalculate()
@@ -116,13 +118,13 @@ void RulerItem2::recalculate()
}
// always show the text bellow the lowest of the start and end points
qreal tgtY = (startPoint.y() >= endPoint.y()) ? startPoint.y() : endPoint.y();
- textItem->setPos(tgtX - 1, tgtY + 4);
+ // this isn't exactly optimal, since we want to scale the 1.0, 4.0 distances as well
+ textItem->setPos(tgtX - 1.0, tgtY + 4.0);
// setup the text background
textItemBack->setVisible(startPoint.x() != endPoint.x());
- QPointF wh = mapFromScene(view->mapToScene(QPoint(textItem->boundingRect().width(),
- textItem->boundingRect().height())));
- textItemBack->setRect(tgtX - 2, tgtY + 3, wh.x() + 2, wh.y() + 3);
+ textItemBack->setPos(textItem->x(), textItem->y());
+ textItemBack->setRect(0, 0, textItem->boundingRect().width(), textItem->boundingRect().height());
}
RulerNodeItem2 *RulerItem2::sourceNode() const