diff layer/Colour3DPlotLayer.cpp @ 20:1deb5f87a18c

* Add getXForFrame / getFrameForX in preference to using the zoom level everywhere
author Chris Cannam
date Mon, 30 Jan 2006 13:19:42 +0000
parents 484e7320f59f
children 6b794a2af3d9
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Fri Jan 27 18:04:07 2006 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Mon Jan 30 13:19:42 2006 +0000
@@ -181,10 +181,8 @@
     //direction.  This one is only really appropriate for models with
     //far fewer bins in both directions.
 
-    int sx0 = ((startFrame + x0 * zoomLevel) - int(modelStart)) /
-	int(modelWindow);
-    int sx1 = ((startFrame + x1 * zoomLevel) - int(modelStart)) / 
-	int(modelWindow);
+    int sx0 = int((getFrameForX(x0) - long(modelStart)) / long(modelWindow));
+    int sx1 = int((getFrameForX(x1) - long(modelStart)) / long(modelWindow));
     int sw = sx1 - sx0;
     int sh = m_model->getYBinCount();
 
@@ -202,10 +200,8 @@
 
 	for (int sy = 0; sy < sh; ++sy) {
 
-	    int rx0 = ((fx + int(modelStart))
-		       - int(startFrame)) / zoomLevel;
-	    int rx1 = ((fx + int(modelWindow) + int(modelStart))
-		       - int(startFrame)) / zoomLevel;
+	    int rx0 = getXForFrame(fx + int(modelStart));
+	    int rx1 = getXForFrame(fx + int(modelStart) + int(modelWindow));
 
 	    int ry0 = h - (sy * h) / sh - 1;
 	    int ry1 = h - ((sy + 1) * h) / sh - 2;