summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornokangaroo <[email protected]>2017-06-21 09:24:54 +0200
committerraveit65 <[email protected]>2017-08-26 11:32:35 +0200
commitd4b4d08300fe27dbb57ad10ba31a91c5cfd54781 (patch)
tree806ddb2bd2db03df6f4ce3dd3332683cb98d25a2 /src
parentd3b66148f9b914fa0451508c6ddb075d0fab8fdb (diff)
downloadcaja-d4b4d08300fe27dbb57ad10ba31a91c5cfd54781.tar.bz2
caja-d4b4d08300fe27dbb57ad10ba31a91c5cfd54781.tar.xz
Fix off-by-one error in caja-pathbar.c
Diffstat (limited to 'src')
-rw-r--r--src/caja-pathbar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index bafd8e66..444a0b1e 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -1426,7 +1426,9 @@ set_label_padding_size (ButtonData *button_data)
pango_layout_get_pixel_size (layout, &bold_width, &bold_height);
pad_left = (bold_width - width) / 2;
- pad_right = (bold_width - width) / 2;
+ pad_right = (bold_width + 1 - width) / 2; /* this ensures rounding up - the
+ pixel size difference between bold and normal fonts is not always even and
+ will give an off-by-one error when dividing by 2 */
gtk_widget_set_margin_start (GTK_WIDGET (button_data->label), pad_left);
gtk_widget_set_margin_end (GTK_WIDGET (button_data->label), pad_right);