Skip to content

Commit

Permalink
Fix bad waterfall texture offset
Browse files Browse the repository at this point in the history
Was offset by 1 pixel..
  • Loading branch information
cjcliffe committed Oct 27, 2015
1 parent 7027e7b commit 8c53bde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/panel/WaterfallPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void WaterfallPanel::drawPanelContents() {
float half_pixel = 1.0 / viewWidth;
float half_texel = 1.0 / (float) half_fft_size;
float vtexel = 1.0 / (float) waterfall_lines;
float vofs = (float) (waterfall_ofs[0] + 1) * vtexel;
float vofs = (float) (waterfall_ofs[0]) * vtexel;

glBindTexture(GL_TEXTURE_2D, waterfall[0]);
glBegin (GL_QUADS);
Expand All @@ -191,7 +191,7 @@ void WaterfallPanel::drawPanelContents() {
glVertex3f(-1.0, 1.0, 0.0);
glEnd();

vofs = (float) (waterfall_ofs[1] + 1) * vtexel;
vofs = (float) (waterfall_ofs[1]) * vtexel;
glBindTexture(GL_TEXTURE_2D, waterfall[1]);
glBegin(GL_QUADS);
glTexCoord2f(0.0 + half_texel, 1.0 + vofs);
Expand Down

0 comments on commit 8c53bde

Please sign in to comment.