#include "i18n.h"
-#define REFLECTION_HEIGHT 2
+#define BASELINESTRETCH (1.25)
using namespace Gdk;
using namespace Gtk;
* 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);
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) {
_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;
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)) {
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
_led_rect = new cairo_rectangle_t;
if (_elements & Text) {
- int led_xoff = ceil(char_pixel_width() + _diameter * .5);
if (_led_left) {
- _led_rect->x = led_xoff;
+ _led_rect->x = char_pixel_width();
} else {
- _led_rect->x = get_width() - led_xoff;
+ _led_rect->x = get_width() - char_pixel_width() + _diameter;
}
} else {
/* centered */
- _led_rect->x = .5 * (get_width() - _diameter);
+ _led_rect->x = .5 * get_width() - _diameter;
}
_led_rect->y = .5 * (get_height() - _diameter);