From bd441d4c61d6e4e6c8e4987d0d2b4b995c815b14 Mon Sep 17 00:00:00 2001 From: nokangaroo Date: Wed, 21 Jun 2017 09:24:54 +0200 Subject: Fix off-by-one error in caja-pathbar.c --- src/caja-pathbar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.1