From c4856d784b9cd69dc92e4674844cbb09d3bcffc7 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Fri, 7 Feb 2020 18:19:56 +0200 Subject: [PATCH] cairo: always have space for < at single line mode --- lib/renderers/cairo.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/renderers/cairo.h b/lib/renderers/cairo.h index cb5d55c..66802b2 100644 --- a/lib/renderers/cairo.h +++ b/lib/renderers/cairo.h @@ -324,13 +324,10 @@ bm_cairo_paint(struct cairo *cairo, uint32_t width, uint32_t max_height, const s /* single-line mode */ bm_pango_get_text_extents(cairo, &paint, &result, "lorem ipsum lorem ipsum lorem ipsum lorem"); uint32_t cl = fmin(title_x + result.x_advance, width / 4); - - if (menu->wrap || menu->index > 0) { - paint.pos = (struct pos){ cl, vpadding }; - paint.box = (struct box){ 1, 2, vpadding, vpadding, 0, ascii_height }; - bm_cairo_draw_line(cairo, &paint, &result, "<"); - cl += result.x_advance + 1; - } + paint.pos = (struct pos){ cl, vpadding }; + paint.box = (struct box){ 1, 2, vpadding, vpadding, 0, ascii_height }; + bm_cairo_draw_line(cairo, &paint, &result, ((menu->wrap || menu->index > 0) ? "<" : " ")); + cl += result.x_advance + 1; for (uint32_t i = menu->index; i < count && cl < (width/cairo->scale); ++i) { bool highlighted = (items[i] == bm_menu_get_highlighted_item(menu));