Mercurial > hg > svgui
diff layer/VerticalBinLayer.h @ 1085:179ea8a2f650 spectrogram-minor-refactor
Add VerticalBinLayer to SpectrogramLayer
author | Chris Cannam |
---|---|
date | Fri, 01 Jul 2016 17:54:31 +0100 |
parents | 7122aae95a88 |
children | 67dd16e33a3d |
line wrap: on
line diff
--- a/layer/VerticalBinLayer.h Fri Jul 01 11:37:46 2016 +0100 +++ b/layer/VerticalBinLayer.h Fri Jul 01 17:54:31 2016 +0100 @@ -36,7 +36,9 @@ /** * As getYForBin, but rounding to integer values. */ - virtual int getIYForBin(LayerGeometryProvider *, int bin) const = 0; + virtual int getIYForBin(LayerGeometryProvider *v, int bin) const { + return int(round(getYForBin(v, bin))); + } /** * Return the bin number, possibly fractional, at the given y @@ -49,7 +51,9 @@ /** * As getBinForY, but rounding to integer values. */ - virtual int getIBinForY(LayerGeometryProvider *, int y) const = 0; + virtual int getIBinForY(LayerGeometryProvider *v, int y) const { + return int(floor(getBinForY(v, y))); + } }; #endif