From 5d70985bb95121560de4c2556da1fac16a55f84b Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 4 Jan 2017 22:46:46 +0100 Subject: [PATCH] Reset line style, reset state after drawing border. --- source/theme.c | 2 ++ source/widgets/widget.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/source/theme.c b/source/theme.c index 56252610..299c900b 100644 --- a/source/theme.c +++ b/source/theme.c @@ -397,6 +397,8 @@ void distance_get_linestyle ( Distance d, cairo_t *draw ) if ( d.style == DASH ){ const double dashes[1] = { 4 }; cairo_set_dash ( draw, dashes, 1, 0.0 ); + } else { + cairo_set_dash ( draw, NULL, 0, 0.0); } } diff --git a/source/widgets/widget.c b/source/widgets/widget.c index 4a53bb59..dbe5b389 100644 --- a/source/widgets/widget.c +++ b/source/widgets/widget.c @@ -118,6 +118,7 @@ void widget_draw ( widget *widget, cairo_t *d ) int right = distance_get_pixel ( widget->border.right, ORIENTATION_VERTICAL ); int bottom = distance_get_pixel ( widget->border.bottom, ORIENTATION_VERTICAL ); if ( left || top || right || bottom ) { + cairo_save ( d ); rofi_theme_get_color ( widget, "foreground", d ); if ( left > 0 ) { cairo_set_line_width ( d, left ); @@ -147,6 +148,7 @@ void widget_draw ( widget *widget, cairo_t *d ) cairo_line_to ( d, widget->w-margin_right, widget->h-bottom/2.0-margin_bottom); cairo_stroke ( d ); } + cairo_restore (d); } widget->draw ( widget, d ); widget->need_redraw = FALSE;