From c38898f1a655901703a24be5ff7be2f2b0ad217e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 5 Jul 2013 04:26:35 +0200 Subject: fix alignment of meter tick --- gtk2_ardour/gain_meter.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/gain_meter.cc') diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index c1a2b3e0dc..fc458cb66d 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -1054,17 +1054,20 @@ GainMeter::render_metrics (Gtk::Widget& w, vector types) for (vector::const_iterator j = points.begin(); j != points.end(); ++j) { + gint pos; + float fraction = 0; switch (*i) { case DataType::AUDIO: fraction = log_meter (*j); + pos = height - (gint) floor (height * fraction); break; case DataType::MIDI: fraction = *j / 127.0; + pos = 1 + height - (gint) floor (height * fraction); break; } - gint const pos = 1 + height - (gint) floor (height * fraction); float const linepos = min((float) height, (float)(pos + .5f)); cairo_set_line_width (cr, 1.0); -- cgit v1.2.3