fix typo
[ardour.git] / gtk2_ardour / ardour_button.cc
index eab462f9026daa68a42b5252fa83ea564e7ab04c..f4aa1225f0ec0b73fc5add22d56ef77da1e78e3c 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "i18n.h"
 
-#define REFLECTION_HEIGHT 2
+#define BASELINESTRETCH (1.25)
 
 using namespace Gdk;
 using namespace Gtk;
@@ -400,9 +400,9 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
                         * TODO this should be generalized incl rotation.
                         * currently only 'user' of this API is meter_strip.cc
                         */
-                       if (_xalign < 0) xa = .5 + (ww * fabs(_xalign) + text_margin);
+                       if (_xalign < 0) xa = ceil(.5 + (ww * fabs(_xalign) + text_margin));
 
-                       cairo_move_to (cr, rint(xa), rint(ya));
+                       cairo_move_to (cr, xa, ya);
                        pango_cairo_update_layout(cr, _layout->gobj());
                        pango_cairo_show_layout (cr, _layout->gobj());
                        cairo_restore (cr);
@@ -543,7 +543,7 @@ ArdourButton::set_corner_radius (float r)
 void
 ArdourButton::on_size_request (Gtk::Requisition* req)
 {
-       req->height = req->height = 0;
+       req->width = req->height = 0;
        CairoWidget::on_size_request (req);
 
        if (_diameter == 0) {
@@ -556,7 +556,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
                _text_height = char_pixel_height ();
                req->width += char_pixel_width();
                req->width += _text_width;
-               req->height = std::max(req->height, (int) ceil(_text_height * 1.25));
+               req->height = std::max(req->height, (int) ceil(_text_height * BASELINESTRETCH));
        } else {
                _text_width = 0;
                _text_height = 0;
@@ -569,7 +569,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
 
        if (_elements & Indicator) {
                req->width += lrint (_diameter) + 2 * char_pixel_width();
-               req->height = std::max (req->height, (int) lrint (_diameter) + 2);
+               req->height = std::max (req->height, (int) lrint (_diameter) + 4);
        }
 
        if ((_elements & Menu)) {
@@ -578,13 +578,13 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
 
        if (_elements & (RecButton | CloseCross)) {
                assert(!(_elements & Text));
-               const int wh = std::max(char_pixel_width(), char_pixel_height()) * 1.25;
+               const int wh = std::max(char_pixel_width(), char_pixel_height()) * BASELINESTRETCH;
                req->width += wh;
                req->height = std::max(req->height, (int) wh);
        }
 
        req->width += ceil(_corner_radius);
-       req->height += ceil(_corner_radius);
+       //req->height += ceil(_corner_radius);
 
        if (_tweaks & Square) {
                // squared buttons are also grouped, we cannot align all texts