From e02efddb219df379869a4362fa939be36b2aa1f1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 25 Oct 2014 16:15:54 +0200 Subject: skip meter re-draw when no pixels are changed. --- libs/gtkmm2ext/fastmeter.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc index 15f38db20a..3d28253c41 100644 --- a/libs/gtkmm2ext/fastmeter.cc +++ b/libs/gtkmm2ext/fastmeter.cc @@ -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; } -- cgit v1.2.3