diff options
author | Phil Jones <philj56@gmail.com> | 2022-07-29 12:44:02 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-07-29 14:32:35 +0100 |
commit | 82d4c237d1f501cd7b0b8afc53ed87fd3ccf0e18 (patch) | |
tree | 87f81278d8bbecaab1f8030f1fe5846e9a5ce28e /src/entry_backend/harfbuzz.c | |
parent | 96fb966e7b89846fa8305d5dc521a113fcfab82b (diff) |
Add --selection-padding option.
This adds some extra padding in the selection background, rather than
tightly wrapping the selection text.
Diffstat (limited to 'src/entry_backend/harfbuzz.c')
-rw-r--r-- | src/entry_backend/harfbuzz.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/entry_backend/harfbuzz.c b/src/entry_backend/harfbuzz.c index af1aad7..db3be66 100644 --- a/src/entry_backend/harfbuzz.c +++ b/src/entry_backend/harfbuzz.c @@ -257,7 +257,10 @@ void entry_backend_harfbuzz_update(struct entry *entry) cairo_save(cr); color = entry->selection_background_color; cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a); - cairo_rectangle(cr, 0, 0, width, font_extents.height); + uint32_t pad = entry->selection_background_padding; + cairo_translate(cr, -pad, 0); + cairo_rectangle(cr, 0, 0, width + pad * 2, font_extents.height); + cairo_translate(cr, pad, 0); cairo_fill(cr); cairo_restore(cr); cairo_paint(cr); |