Open wose opened 2 years ago
(Submitted by crazy_imp on irc)
The waterfall widget does not interpolate between pixels, the spectrum widget does. This leads to an offset between the two displays depending on the available width for the waterfall widget:
// we do not interpolate between pixels so we just zoom slightly in and display
// the area.width pixel in the center of the waterfall
let start = (styles.len() - area.width as usize) / 2;
for (column, style) in styles
.iter()
.skip(start)
.take(area.width as usize)
.enumerate() {
buf.set_string(
area.left() + column as u16,
area.top() + row as u16,
PIX,
*style,
);
}
We already try to scale the frequency down to almost the available width. We should stop doing this and instead scale to exactly the correct width and build the pixels using the max (since we don't want to loose narrow signals) between two scaled frequencies (columns).