summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-16 15:43:38 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-16 15:43:38 -0300
commite3cb36498d97750a9a961be21f5adb9073fa6863 (patch)
tree0d5caaa2a57d352ef8ee7f9fe5365957139e3b46
parent30297ebd4bbe9d3048e7c4401b3b4b22c24305e0 (diff)
downloadsubsurface-e3cb36498d97750a9a961be21f5adb9073fa6863.tar.gz
Fixed the loading of some maps
On some maps, the lack of setting up the dc before plotting the dive-computer nick caused a division by zero, breaking the correct visualization of the dive. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r--qt-ui/profilegraphics.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 8f25f1932..e5212be1e 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -312,6 +312,9 @@ void ProfileGraphicsView::plot(struct dive *d)
if (nick.isEmpty())
nick = tr("unknown divecomputer");
+ gc.leftx = 0; gc.rightx = 1.0;
+ gc.topy = 0; gc.bottomy = 1.0;
+
text_render_options_t computer = {DC_TEXT_SIZE, TIME_TEXT, LEFT, MIDDLE};
diveComputer = plot_text(&computer, QPointF(gc.leftx, gc.bottomy), nick);
// The Time ruler should be right after the DiveComputer: