From e23fdd5b8cbdb957dedc15f7da9cf4d3d1a21bbd Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 3 Jun 2025 11:34:21 -0600 Subject: [PATCH] horrific hack to deal with pianoroll header (widget) single pixel misalignment currently not understood --- gtk2_ardour/prh_base.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk2_ardour/prh_base.cc b/gtk2_ardour/prh_base.cc index 019d0a1fd2..f0865b549c 100644 --- a/gtk2_ardour/prh_base.cc +++ b/gtk2_ardour/prh_base.cc @@ -233,6 +233,20 @@ PianoRollHeaderBase::render (ArdourCanvas::Rect const & self, ArdourCanvas::Rect draw_transform (origin_x, origin_y); cr->save (); + + /* XXX this is s horrible hack. For some reason, there is an off-by-one + * error with the drawing transform for the Gtk::Widget-derived version + * of this class. It is unclear right now (June 2025) where the extra + * pixel offset comes from. Correct it only for the case where the + * transform does nothing, which is (currently) only true for the + * Gtk::Widget case. + */ + + if (origin_y == 0.) { + origin_y -= 1; + } + + cr->translate (origin_x, origin_y); // Render the MIDNAM text or its equivalent. First, set up a clip