Waveform fixes

- Due to a floating point division error not all the bars on the waveform were
  being drawn.
- Fix ratio in the fragment shader
This commit is contained in:
Thomas Wilshaw
2020-05-05 11:29:15 +01:00
parent 921a5f357e
commit 1e81969fca
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -98,7 +98,8 @@ void WaveformScope::DrawScope()
QFontMetrics font_metrics = QFontMetrics(QFont());
QString label;
float ire_increment = 0.1f;
float ire_steps = int(1.0 / ire_increment);
// Cast required to avoid floating point errors
int ire_steps = static_cast<int>(std::round(1.0 / ire_increment));
QVector<QLine> ire_lines(ire_steps + 1);
int font_x_offset = 0;
int font_y_offset = font_metrics.capHeight() / 2.0f;