diff options
author | Timm Bäder <mail@baedert.org> | 2016-01-12 21:37:27 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2016-01-12 21:56:53 +0100 |
commit | b8db48079f7716290464cbee9ae879c95d406c65 (patch) | |
tree | 2a4f0dd5bf418ce5aaac19c329d4237ac0e6e36c /gtk/gtkswitch.c | |
parent | a8ceeb17667e40b61806e3e9a8e631c304e30b17 (diff) | |
download | gtk+-b8db48079f7716290464cbee9ae879c95d406c65.tar.gz |
switch: Fix text positioning
https://bugzilla.gnome.org/show_bug.cgi?id=760509
Diffstat (limited to 'gtk/gtkswitch.c')
-rw-r--r-- | gtk/gtkswitch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 9f6f6596ba..249753b457 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -624,8 +624,8 @@ gtk_switch_render_trough (GtkCssGadget *gadget, pango_layout_get_pixel_extents (layout, NULL, &rect); - label_x = ((width / 2) - rect.width) / 2; - label_y = (height - rect.height) / 2; + label_x = x + ((width / 2) - rect.width) / 2; + label_y = y + (height - rect.height) / 2; gtk_render_layout (context, cr, label_x, label_y, layout); @@ -638,8 +638,8 @@ gtk_switch_render_trough (GtkCssGadget *gadget, pango_layout_get_pixel_extents (layout, NULL, &rect); - label_x = (width / 2) + ((width / 2) - rect.width) / 2; - label_y = (height - rect.height) / 2; + label_x = x + (width / 2) + ((width / 2) - rect.width) / 2; + label_y = y + (height - rect.height) / 2; gtk_render_layout (context, cr, label_x, label_y, layout); |