1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Clip text with extents rectangle

Fonts are not ideal, some characters have mismatch between reported and
painted size.
This commit is contained in:
Nikita Zlobin 2023-08-27 23:25:59 +05:00 committed by Dave Davenport
parent 51a8df9da5
commit 9b2b52b13e

View file

@ -568,7 +568,11 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
// draw the text // draw the text
cairo_save(draw); cairo_save(draw);
double x1, y1, x2, y2;
cairo_clip_extents(draw, &x1, &y1, &x2, &y2);
cairo_reset_clip(draw); cairo_reset_clip(draw);
cairo_rectangle(draw, x1, y1, x2 - x1, y2 - y1);
cairo_clip(draw);
gboolean show_outline = gboolean show_outline =
rofi_theme_get_boolean(WIDGET(tb), "text-outline", FALSE); rofi_theme_get_boolean(WIDGET(tb), "text-outline", FALSE);