mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
fix alignment of meter tick
This commit is contained in:
parent
d4b1941796
commit
c38898f1a6
2 changed files with 6 additions and 3 deletions
|
|
@ -1054,17 +1054,20 @@ GainMeter::render_metrics (Gtk::Widget& w, vector<DataType> types)
|
|||
|
||||
for (vector<int>::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);
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ MeterStrip::render_metrics (Gtk::Widget& w, vector<DataType> types)
|
|||
}
|
||||
fraction = log_meter (j->first);
|
||||
snprintf (buf, sizeof (buf), "%+2d", j->first);
|
||||
pos = 1 + height - (gint) floor (height * fraction);
|
||||
pos = height - (gint) floor (height * fraction);
|
||||
cairo_move_to(cr, width-2.5, pos + .5);
|
||||
cairo_line_to(cr, width, pos + .5);
|
||||
cairo_stroke (cr);
|
||||
|
|
@ -717,7 +717,7 @@ MeterStrip::render_ticks (Gtk::Widget& w, vector<DataType> types)
|
|||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
}
|
||||
fraction = log_meter (j->first);
|
||||
pos = 1 + height - (gint) floor (height * fraction);
|
||||
pos = height - (gint) floor (height * fraction);
|
||||
cairo_move_to(cr, 0, pos + .5);
|
||||
cairo_line_to(cr, 3, pos + .5);
|
||||
cairo_stroke (cr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue