changeset 16:02a718909b2d

* Fixes to playback of short looped files, of synthesised content within looped sections, and a few other fixes
author Chris Cannam
date Thu, 26 Jan 2006 11:56:09 +0000
parents 4d5d9aba406b
children 0183ebb725ca
files layer/TimeInstantLayer.cpp
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/layer/TimeInstantLayer.cpp	Wed Jan 25 17:46:28 2006 +0000
+++ b/layer/TimeInstantLayer.cpp	Thu Jan 26 11:56:09 2006 +0000
@@ -297,15 +297,19 @@
 	const SparseOneDimensionalModel::Point &p(*i);
 
 	int x = (p.frame - startFrame) / zoomLevel;
-	int w = m_model->getResolution() / zoomLevel;
+	float w = float(m_model->getResolution()) / zoomLevel;
+	int iw = w;
+	if (iw < 2) {
+	    if (w < 0.5) iw = 1;
+	    else iw = 2;
+	}
 
-	if (w < 1) w = 1;
 	if (p.frame == illuminateFrame) {
 	    paint.setPen(Qt::black); //!!!
 	} else {
 	    paint.setPen(brushColour);
 	}
-	paint.drawRect(x, 0, w - 1, m_view->height() - 1);
+	paint.drawRect(x, 0, iw - 1, m_view->height() - 1);
 	paint.setPen(m_colour);
 	
 	if (p.label != "") {