mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
hack to ArdourButton to get sizing correct for 90 + 270 degree rotated text
This commit is contained in:
parent
0b4d9c9d63
commit
effb08c121
1 changed files with 11 additions and 0 deletions
|
|
@ -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));
|
req->height = std::max(req->height, (int) ceil(char_pixel_height() * BASELINESTRETCH + 1.0));
|
||||||
assert (_layout);
|
assert (_layout);
|
||||||
_layout->get_pixel_size (_text_width, _text_height);
|
_layout->get_pixel_size (_text_width, _text_height);
|
||||||
|
|
||||||
req->width += rint(1.75 * char_pixel_width()); // padding
|
req->width += rint(1.75 * char_pixel_width()); // padding
|
||||||
req->width += _text_width;
|
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 {
|
} else {
|
||||||
_text_width = 0;
|
_text_width = 0;
|
||||||
_text_height = 0;
|
_text_height = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue