From 81bbe323eff28187113e3dc2b65072f28c5fbc2d Mon Sep 17 00:00:00 2001
From: Mark Watkins <jedimark@users.sourceforge.net>
Date: Wed, 6 Aug 2014 13:07:16 +1000
Subject: [PATCH] More tweaks to linechart overlay hovers

---
 sleepyhead/Graphs/gGraphView.cpp   | 2 +-
 sleepyhead/Graphs/gLineChart.cpp   | 2 +-
 sleepyhead/Graphs/gLineOverlay.cpp | 8 +++++---
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/sleepyhead/Graphs/gGraphView.cpp b/sleepyhead/Graphs/gGraphView.cpp
index acd6fd8a..72e588e0 100644
--- a/sleepyhead/Graphs/gGraphView.cpp
+++ b/sleepyhead/Graphs/gGraphView.cpp
@@ -514,7 +514,7 @@ void gGraphView::DrawTextQue(QPainter &painter)
                 painter.rotate(+q.angle);
                 painter.translate(-xxx, -yyy);
             } else {
-                painter.drawPixmap(QRect(q.x - buf / 2, q.y - h + buf, w, h), pm);
+                painter.drawPixmap(QRect(q.x - buf / 2 + 4, q.y - h + buf, w, h), pm);
             }
         } else {
             // Just draw the fonts..
diff --git a/sleepyhead/Graphs/gLineChart.cpp b/sleepyhead/Graphs/gLineChart.cpp
index bf7aaabc..741941dd 100644
--- a/sleepyhead/Graphs/gLineChart.cpp
+++ b/sleepyhead/Graphs/gLineChart.cpp
@@ -172,7 +172,7 @@ skipcheck:
             if (chan->type() == schema::FLAG) {
                 lob = new gLineOverlayBar(code, chan->defaultColor(), chan->label(), FT_Bar);
             } else if (chan->type() == schema::MINOR_FLAG) {
-                lob = new gLineOverlayBar(code, chan->defaultColor(), chan->label(), FT_Dot);
+                lob = new gLineOverlayBar(code, chan->defaultColor(), chan->label(), FT_Bar);
             } else if (chan->type() == schema::SPAN) {
                 lob = new gLineOverlayBar(code, chan->defaultColor(), chan->label(), FT_Span);
             }
diff --git a/sleepyhead/Graphs/gLineOverlay.cpp b/sleepyhead/Graphs/gLineOverlay.cpp
index a57be838..8efccf28 100644
--- a/sleepyhead/Graphs/gLineOverlay.cpp
+++ b/sleepyhead/Graphs/gLineOverlay.cpp
@@ -50,7 +50,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
 
     if (xx <= 0) { return; }
 
-    float x1, x2;
+    double x1, x2;
 
     int x, y;
 
@@ -261,7 +261,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
 
 
                     } else {
-                        if (!m_blockhover && QRect(x1-d1-2, topp, d1+6, height).contains(mouse)) {
+                        if (!m_blockhover && QRect(x1-2, topp, 6, height).contains(mouse)) {
                             if (!m_hover) {
                                 m_hover = true;
 
@@ -271,8 +271,10 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
                                 painter.setPen(QPen(Qt::gray,1));
                                 painter.drawRect(x1 - (x / 2) - x, start_py + 14 + (3 * w.printScaleY()), x+4,y+4);
                                 w.renderText(lab, x1 - (x / 2)+2 - x, start_py + 14 + y + (3 * w.printScaleY()),0);
-                                x1-=1;
+                                //x1-=1;
                                 painter.setPen(QPen(m_flag_color,4));
+                            } else {
+                                painter.setPen(QPen(m_flag_color,1));
                             }
                         } else {
                             painter.setPen(QPen(m_flag_color,1));