From 37e20bf504f7a2b78c82eda86f68c075c72d2d3c Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Thu, 28 Aug 2014 00:41:16 +1000 Subject: [PATCH] Try making snapshot graphs scale when resized --- sleepyhead/Graphs/gGraph.cpp | 2 +- sleepyhead/Graphs/gGraphView.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sleepyhead/Graphs/gGraph.cpp b/sleepyhead/Graphs/gGraph.cpp index 48d8f104..562ae7c0 100644 --- a/sleepyhead/Graphs/gGraph.cpp +++ b/sleepyhead/Graphs/gGraph.cpp @@ -322,7 +322,7 @@ void gGraph::paint(QPainter &painter, const QRegion ®ion) if (m_issnapshot) { - painter.drawPixmap(0, originY, m_snapshot); + painter.drawPixmap(QRect(0, originY,width,height), m_snapshot, m_snapshot.rect()); QLinearGradient linearGrad(QPointF(100, 100), QPointF(width / 2, 100)); linearGrad.setColorAt(0, QColor(255, 150, 150,30)); linearGrad.setColorAt(1, QColor(255,255,255,20)); diff --git a/sleepyhead/Graphs/gGraphView.cpp b/sleepyhead/Graphs/gGraphView.cpp index d932d46e..faf5e454 100644 --- a/sleepyhead/Graphs/gGraphView.cpp +++ b/sleepyhead/Graphs/gGraphView.cpp @@ -2101,7 +2101,7 @@ void gGraphView::onSnapshotGraphToggle() newgraph->setSnapshot(pm); newgraph->setBlockSelect(true); newgraph->setHeight(pm.height()); - newgraph->setMinHeight(pm.height()); + //newgraph->setMinHeight(pm.height()); m_graphs.insert(m_graphs.indexOf(graph)+1, newgraph); m_graphsbyname[newname] = newgraph;