display waveform polarity correctly

* cairo's Y axis points downward -> invert phase display
* fix logarithmic view for value.max < 0
This commit is contained in:
Robin Gareus 2013-04-18 10:25:09 +02:00
parent 731b2c1ae9
commit b7aeb147f2

View file

@ -444,7 +444,7 @@ WaveView::CacheEntry::image ()
if (y > 0.0) { if (y > 0.0) {
context->line_to (i + 0.5, position (alt_log_meter (fast_coefficient_to_dB (y)))); context->line_to (i + 0.5, position (alt_log_meter (fast_coefficient_to_dB (y))));
} else if (y < 0.0) { } else if (y < 0.0) {
context->line_to (i + 0.5, position (alt_log_meter (fast_coefficient_to_dB (-y)))); context->line_to (i + 0.5, position (-alt_log_meter (fast_coefficient_to_dB (-y))));
} else { } else {
context->line_to (i + 0.5, position (0.0)); context->line_to (i + 0.5, position (0.0));
} }
@ -559,7 +559,7 @@ WaveView::CacheEntry::position (double s) const
default: default:
break; break;
} }
return (s+1.0) * (_wave_view->_height / 2.0); return (1.0-s) * (_wave_view->_height / 2.0);
} }
void void