Reset line style, reset state after drawing border.

This commit is contained in:
Dave Davenport 2017-01-04 22:46:46 +01:00
parent 9dd3cb312e
commit 5d70985bb9
2 changed files with 4 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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;