summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-05 23:43:09 +0200
committerRobin Gareus <robin@gareus.org>2014-09-05 23:43:09 +0200
commit42ef3cab328b922c897fcc1da9b4f33f21279c44 (patch)
treedf8cb198495beb5dd9b0afef66033b696506550b /gtk2_ardour/ardour_button.cc
parent50d3afd96576ee756b1b61a6b0cb8153b0f5cba1 (diff)
no more button text position rounding
For all non-grouped buttons, size request takes care of assigning a proper geometry.
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index ad81942334..b60cf0b85a 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -370,17 +370,18 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_new_path (cr);
ArdourCanvas::set_source_rgba (cr, text_color);
+ const double text_ypos = (get_height() - _text_height) * .5;
if (_elements & Menu) {
// always left align (dropdown)
- cairo_move_to (cr, text_margin, rint((get_height() - _text_height) * .5));
+ cairo_move_to (cr, text_margin, text_ypos);
pango_cairo_show_layout (cr, _layout->gobj());
} else if ( (_elements & Indicator) == Indicator) {
// left/right align depending on LED position
if (_led_left) {
- cairo_move_to (cr, rint(text_margin + _diameter + char_pixel_width()), rint((get_height() - _text_height) * .5));
+ cairo_move_to (cr, text_margin + _diameter + .5 * char_pixel_width(), text_ypos);
} else {
- cairo_move_to (cr, text_margin, rint((get_height() - _text_height) * .5));
+ cairo_move_to (cr, text_margin, text_ypos);
}
pango_cairo_show_layout (cr, _layout->gobj());
} else {