summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetextitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divetextitem.cpp')
-rw-r--r--qt-ui/profile/divetextitem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp
index fcc0517f1..5ace46b5e 100644
--- a/qt-ui/profile/divetextitem.cpp
+++ b/qt-ui/profile/divetextitem.cpp
@@ -7,6 +7,7 @@
#include <QFontMetrics>
#include <QBrush>
#include <QPen>
+#include <QDebug>
DiveTextItem::DiveTextItem(QGraphicsItem* parent): QGraphicsItemGroup(parent),
textBackgroundItem(NULL),
@@ -50,10 +51,10 @@ void DiveTextItem::updateText()
QRectF rect = fm.boundingRect(text);
yPos = (internalAlignFlags & Qt::AlignTop) ? -rect.height() :
- (internalAlignFlags & Qt::AlignBottom) ? 0 :
- /*(internalAlignFlags & Qt::AlignVCenter ? */ -rect.height() / 2;
+ (internalAlignFlags & Qt::AlignBottom) ? +rect.height() :
+ /*(internalAlignFlags & Qt::AlignVCenter ? */ +rect.height() / 4;
- yPos = (internalAlignFlags & Qt::AlignLeft ) ? 0 :
+ xPos = (internalAlignFlags & Qt::AlignLeft ) ? +rect.width() :
(internalAlignFlags & Qt::AlignHCenter) ? -rect.width()/2 :
/* (internalAlignFlags & Qt::AlignRight) */ -rect.width();