diff --git a/gtk2_ardour/prh.cc b/gtk2_ardour/prh.cc index 666878a4cf..c896cfd558 100644 --- a/gtk2_ardour/prh.cc +++ b/gtk2_ardour/prh.cc @@ -98,10 +98,10 @@ PianoRollHeader::size_request (double& w, double& h) const if (show_scroomer()) { _scroomer_size = 60.f * UIConfiguration::instance().get_ui_scale(); } else { - _scroomer_size = 20.f * UIConfiguration::instance().get_ui_scale(); + _scroomer_size = kbd_width * UIConfiguration::instance().get_ui_scale(); } - w = _scroomer_size + 20.; + w = _scroomer_size + (kbd_width * UIConfiguration::instance().get_ui_scale()); } bool diff --git a/gtk2_ardour/prh_base.cc b/gtk2_ardour/prh_base.cc index e801fdca80..2febf02b50 100644 --- a/gtk2_ardour/prh_base.cc +++ b/gtk2_ardour/prh_base.cc @@ -241,7 +241,6 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect origin_y -= 1; } - cr->translate (origin_x, origin_y); // Render the MIDNAM text or its equivalent. First, set up a clip @@ -351,13 +350,14 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect } - Gtkmm2ext::set_source_rgba (cr, bg); - double x = _scroomer_size;; + assert (_scroomer_size = width() - kbd_width); + + double x = _scroomer_size; double y = positions[n]; - cr->rectangle (x, y, width() - 1., heights[n]); + cr->rectangle (x, y, kbd_width, heights[n]); cr->fill (); if ((oct_rel == 4 || oct_rel == 11) && y > 0) { @@ -369,7 +369,7 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect which are rects */ cr->move_to (x, y + 0.5); - cr->line_to (x + width(), y + 0.5); + cr->line_to (x + kbd_width, y + 0.5); cr->stroke (); } } diff --git a/gtk2_ardour/prh_base.h b/gtk2_ardour/prh_base.h index a6714819d2..8cc4becba3 100644 --- a/gtk2_ardour/prh_base.h +++ b/gtk2_ardour/prh_base.h @@ -103,6 +103,7 @@ class PianoRollHeaderBase : virtual public sigc::trackable { double _saved_bottom_val; mutable bool _mini_map_display; bool entered; + static const int kbd_width = 20; // void on_size_request(Gtk::Requisition*);