changeset 430:bcaeb2ba9b74

* some plotting tweaks
author Chris Cannam
date Fri, 10 Oct 2008 16:03:48 +0000
parents 427e5c58658e
children 4711b400f976
files layer/TimeValueLayer.cpp
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/layer/TimeValueLayer.cpp	Thu Oct 09 20:10:28 2008 +0000
+++ b/layer/TimeValueLayer.cpp	Fri Oct 10 16:03:48 2008 +0000
@@ -640,13 +640,20 @@
 	}	    
 
 	if (m_plotStyle == PlotStems) {
+/*
 	    paint.setPen(brushColour);
 	    if (y < origin - 1) {
 		paint.drawRect(x + w/2, y + 1, 1, origin - y);
 	    } else if (y > origin + 1) {
 		paint.drawRect(x + w/2, origin, 1, y - origin - 1);
 	    }
+*/
 	    paint.setPen(getBaseQColor());
+	    if (y < origin - 1) {
+		paint.drawLine(x + w/2, y + 1, x + w/2, origin);
+	    } else if (y > origin + 1) {
+		paint.drawLine(x + w/2, origin, x + w/2, y - 1);
+	    }
 	}
 
 	if (illuminateFrame == p.frame) {
@@ -687,8 +694,14 @@
                     paint.restore();
 
 		} else if (m_plotStyle == PlotLines) {
+                    
+                    if (pointCount == 0) {
+                        path.moveTo(x + w/2, y);
+                    }
+                    ++pointCount;
 
-		    paint.drawLine(x + w/2, y, nx + w/2, ny);
+//		    paint.drawLine(x + w/2, y, nx + w/2, ny);
+                    path.lineTo(nx + w/2, ny);
 
 		} else {
 
@@ -739,7 +752,8 @@
 	}
     }
 
-    if (m_plotStyle == PlotCurve && !path.isEmpty()) {
+    if ((m_plotStyle == PlotCurve || m_plotStyle == PlotLines)
+        && !path.isEmpty()) {
 	paint.setRenderHint(QPainter::Antialiasing, pointCount <= v->width());
 	paint.drawPath(path);
     }