skip meter re-draw when no pixels are changed.

This commit is contained in:
Robin Gareus 2014-10-25 16:15:54 +02:00
parent a6ceff61dd
commit e02efddb21
1 changed files with 3 additions and 1 deletions

View File

@ -730,7 +730,9 @@ FastMeter::set (float lvl, float peak)
current_level = lvl;
if (current_level == old_level && current_peak == old_peak && (hold_state == 0 || peak != -1)) {
const float pixscale = (orientation == Vertical) ? pixheight : pixwidth;
#define PIX(X) floor(pixscale * (X))
if (PIX(current_level) == PIX(old_level) && PIX(current_peak) == PIX(old_peak) && (hold_state == 0 || peak != -1)) {
return;
}