diff options
author | Robin Gareus <robin@gareus.org> | 2014-08-30 00:43:24 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-08-30 01:43:10 +0200 |
commit | 4efa0fd77c46694462c129c1071205ae71eadc3d (patch) | |
tree | 0548e8a5f4db63ccd1ba664ebd784842ebc73ec2 /gtk2_ardour/ardour_button.cc | |
parent | bf13bf638548ce2cc65047fda6f2abeeacb50ec3 (diff) |
ArdourButton align text to full pixels
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r-- | gtk2_ardour/ardour_button.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 2873dad621..6c35512e62 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -321,13 +321,13 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *) ArdourCanvas::set_source_rgba (cr, text_color); if ( (_elements & Menu) == Menu) { - cairo_move_to (cr, text_margin, get_height()/2.0 - _text_height/2.0); + cairo_move_to (cr, rint(text_margin), rint((get_height() - _text_height)/2.0)); pango_cairo_show_layout (cr, _layout->gobj()); } else if ( (_elements & Indicator) == Indicator) { if (_led_left) { - cairo_move_to (cr, text_margin + _diameter + 4, get_height()/2.0 - _text_height/2.0); + cairo_move_to (cr, rint(text_margin + _diameter + 4),rint((get_height() - _text_height)/2.0)); } else { - cairo_move_to (cr, text_margin, get_height()/2.0 - _text_height/2.0); + cairo_move_to (cr, rint(text_margin), rint((get_height() - _text_height)/2.0)); } pango_cairo_show_layout (cr, _layout->gobj()); } else { @@ -351,16 +351,13 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *) // TODO honor left/right text_margin with min/max() - cairo_move_to (cr, xa, ya); + cairo_move_to (cr, rint(xa), rint(ya)); pango_cairo_update_layout(cr, _layout->gobj()); pango_cairo_show_layout (cr, _layout->gobj()); cairo_restore (cr); - - /* use old center'ed layout for follow up items - until rotation/aligment code is completed */ - cairo_move_to (cr, (get_width() - _text_width)/2.0, get_height()/2.0 - _text_height/2.0); } cairo_restore (cr); - } + } //Menu "triangle" if (((_elements & Menu)==Menu)) { |