diff options
author | nick87720z <nick87720z@gmail.com> | 2020-06-09 20:17:50 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 17:17:50 +0200 |
commit | e275ed2283c385a1fc7de4670257809578e13e60 (patch) | |
tree | 834b8b6d67f654bb461536c2ecc68bcd7f996e0f /source/widgets | |
parent | 3d5f0f086ccb478cadbbec70533230a700eca1e4 (diff) |
Again final workaround for #303 (#1142)
Diffstat (limited to 'source/widgets')
-rw-r--r-- | source/widgets/textbox.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 01c0dc41..79db938b 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -404,30 +404,6 @@ static void textbox_free ( widget *wid ) g_slice_free ( textbox, tb ); } -/* FIXME: workaround for cairo bug, when subpixel rendering failed with some cairo clip paths */ -static void draw_pango_layout (cairo_t * cr, PangoLayout * layout, int x, int y) -{ - cairo_surface_t * txt_surf; - cairo_t * txt_cr; - - txt_surf = cairo_recording_surface_create (CAIRO_CONTENT_COLOR_ALPHA, NULL); - txt_cr = cairo_create (txt_surf); - - cairo_set_source (txt_cr, cairo_get_source (cr)); - pango_cairo_show_layout (txt_cr, layout); - cairo_destroy (txt_cr); - { - cairo_pattern_t * pat = cairo_get_source (cr); - cairo_pattern_reference (pat); - - cairo_set_source_surface (cr, txt_surf, x, y); - cairo_paint (cr); - - cairo_set_source (cr, pat); - } - cairo_surface_destroy (txt_surf); -} - static void textbox_draw ( widget *wid, cairo_t *draw ) { if ( wid == NULL ) { @@ -471,7 +447,10 @@ static void textbox_draw ( widget *wid, cairo_t *draw ) // Set ARGB // We need to set over, otherwise subpixel hinting wont work. cairo_move_to ( draw, x, top ); - draw_pango_layout (draw, tb->layout, x, top); + cairo_save ( draw ); + cairo_reset_clip ( draw ); + pango_cairo_show_layout ( draw, tb->layout ); + cairo_restore ( draw ); // draw the cursor rofi_theme_get_color ( WIDGET ( tb ), "text-color", draw ); |