diff options
author | Robin Gareus <robin@gareus.org> | 2014-03-21 14:15:38 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-03-21 14:15:38 +0100 |
commit | 9d7efe786541d3ba67fa1755d6f4475c6bdfaece (patch) | |
tree | 47d4756e9ea35a3d0cc49240ee4bb8d046dbc0d8 /libs | |
parent | 65b4308c84a794f6d69da6d229790757d9e4e0e2 (diff) |
tweak meter-peak hold when using LED-striped meters
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/fastmeter.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc index 15963df79b..d4eb21b5e2 100644 --- a/libs/gtkmm2ext/fastmeter.cc +++ b/libs/gtkmm2ext/fastmeter.cc @@ -590,7 +590,10 @@ FastMeter::vertical_expose (cairo_t* cr, cairo_rectangle_t* area) if (hold_state) { last_peak_rect.x = 1; last_peak_rect.width = pixwidth; - last_peak_rect.y = max(1, 1 + pixheight - (gint) floor (pixheight * current_peak)); + last_peak_rect.y = max(1, 1 + pixheight - (int) floor (pixheight * current_peak)); + if (_styleflags & 2) { // LED stripes + last_peak_rect.y = max(0, 2 * (int) floor (last_peak_rect.y / 2)); + } if (bright_hold || (_styleflags & 2)) { last_peak_rect.height = max(0, min(3, pixheight - last_peak_rect.y - 1 )); } else { @@ -786,7 +789,10 @@ FastMeter::queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>& win, float ol queue = true; } rect.x = 1; - rect.y = max(1, 1 + pixheight - (gint) floor (pixheight * current_peak)); + rect.y = max(1, 1 + pixheight - (int) floor (pixheight * current_peak)); + if (_styleflags & 2) { // LED stripes + rect.y = max(0, 2 * (int) floor (rect.y / 2)); + } if (bright_hold || (_styleflags & 2)) { rect.height = max(0, min(3, pixheight - last_peak_rect.y -1 )); } else { |