Skip to content

Commit

Permalink
Clip text with extents rectangle
Browse files Browse the repository at this point in the history
Fonts are not ideal, some characters have mismatch between reported and
painted size.
  • Loading branch information
Nikita Zlobin authored and DaveDavenport committed Aug 27, 2023
1 parent 51a8df9 commit 9b2b52b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/widgets/textbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ static void textbox_draw(widget *wid, cairo_t *draw) {

// draw the text
cairo_save(draw);
double x1, y1, x2, y2;
cairo_clip_extents(draw, &x1, &y1, &x2, &y2);
cairo_reset_clip(draw);
cairo_rectangle(draw, x1, y1, x2 - x1, y2 - y1);
cairo_clip(draw);

gboolean show_outline =
rofi_theme_get_boolean(WIDGET(tb), "text-outline", FALSE);
Expand Down

0 comments on commit 9b2b52b

Please sign in to comment.