From effb08c121ece6435cf05fce09bb0ff73e23d7fe Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 18 May 2016 15:00:52 -0400 Subject: hack to ArdourButton to get sizing correct for 90 + 270 degree rotated text --- gtk2_ardour/ardour_button.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 7008811e3c..305956ff59 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -546,8 +546,19 @@ ArdourButton::on_size_request (Gtk::Requisition* req) req->height = std::max(req->height, (int) ceil(char_pixel_height() * BASELINESTRETCH + 1.0)); assert (_layout); _layout->get_pixel_size (_text_width, _text_height); + req->width += rint(1.75 * char_pixel_width()); // padding req->width += _text_width; + + /* XXX hack (surprise). Deal with two common rotation angles */ + + if (_angle == 90 || _angle == 270) { + /* do not swap text width or height because we rely on + these being the un-rotated values in ::render() + */ + swap (req->width, req->height); + } + } else { _text_width = 0; _text_height = 0; -- cgit v1.2.3