summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-05-18 15:00:52 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:43 -0400
commiteffb08c121ece6435cf05fce09bb0ff73e23d7fe (patch)
tree679a63c03133943688d1a9674f0832a3babe8a66 /gtk2_ardour/ardour_button.cc
parent0b4d9c9d63858a8b7dccd9bd88879e0cd0391881 (diff)
hack to ArdourButton to get sizing correct for 90 + 270 degree rotated text
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc11
1 files changed, 11 insertions, 0 deletions
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;