diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2014-03-12 00:09:53 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-12 11:24:20 -0700 |
commit | f2bfc72648ee11bf1efd33f5f57b78f05a59b52e (patch) | |
tree | c6c4f34af81bf46d2337858d998c6c2238bf8f62 /qt-ui/profile/ruleritem.h | |
parent | 07cd62425df58db6614859cdf70075c7468a8597 (diff) | |
download | subsurface-f2bfc72648ee11bf1efd33f5f57b78f05a59b52e.tar.gz |
Ruler: change how the ruler text drawing works
A couple of problems with the ruler:
- the rotated text doesn't look very well at all and interpolation doesn't
help it much
- measuring towards the right most part of the profile makes the text go
out of the screen
To solve these issues and attempt to improve the ruler this patch does the
following:
- place the text at the bottom of the lowest of the start and end points.
this way the line will never intersect with the text
- clamp the x position, so that the text doesn't ever leave the screen
horizontally
- place a white background behind the text so that it will cover text and
graphics under the ruler item
(TODO: place the ruler on top of everything else)
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/ruleritem.h')
-rw-r--r-- | qt-ui/profile/ruleritem.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/profile/ruleritem.h b/qt-ui/profile/ruleritem.h index 6ab86f44b..7bfc63eee 100644 --- a/qt-ui/profile/ruleritem.h +++ b/qt-ui/profile/ruleritem.h @@ -50,6 +50,7 @@ private: int paint_direction; DiveCartesianAxis *timeAxis; DiveCartesianAxis *depthAxis; + QGraphicsRectItem *textItemBack; QGraphicsSimpleTextItem *textItem; }; -#endif
\ No newline at end of file +#endif |