diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-22 15:08:19 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-22 12:29:41 -0800 |
commit | 2e2a87e6196428280647085527720564c8e3c563 (patch) | |
tree | 4506ed9801e4af7a7f4ceaf3effcab0234f3bb97 /qt-ui/profile/divetextitem.cpp | |
parent | f22428b345524a75527320bc9664ca2257ebe590 (diff) | |
download | subsurface-2e2a87e6196428280647085527720564c8e3c563.tar.gz |
Add a MeanDepthItem that has 2 strings.
Dirk's implementation of the MeanDepth item was correct, but in order to
add the 2 strings to it ( one at the begin, one at the end ) I had to put
more stuff inside the ProfileWidget that's already packed with graphics
items.
So I created a new class MeanDepthItem that contains these 2 strings and
will get updated whenever the value changes.
I also fixed a math inconsistency where I changed RIGHT to LEFT.
(wich fixed a few text-placements, and broke others.)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetextitem.cpp')
-rw-r--r-- | qt-ui/profile/divetextitem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index 0bf071069..163bb64f4 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -59,9 +59,9 @@ void DiveTextItem::updateText() (internalAlignFlags & Qt::AlignBottom) ? +rect.height() : /*(internalAlignFlags & Qt::AlignVCenter ? */ +rect.height() / 4; - xPos = (internalAlignFlags & Qt::AlignLeft ) ? +rect.width() : + xPos = (internalAlignFlags & Qt::AlignLeft ) ? -rect.width() : (internalAlignFlags & Qt::AlignHCenter) ? -rect.width()/2 : - /* (internalAlignFlags & Qt::AlignRight) */ -rect.width(); + /* (internalAlignFlags & Qt::AlignRight) */ 0; textPath.addText( xPos, yPos, fnt, internalText); QPainterPathStroker stroker; |