From 42ef3cab328b922c897fcc1da9b4f33f21279c44 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 5 Sep 2014 23:43:09 +0200 Subject: [PATCH] no more button text position rounding For all non-grouped buttons, size request takes care of assigning a proper geometry. --- gtk2_ardour/ardour_button.cc | 7 ++++--- 1 file 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 {