Clip inside border region when redraw_quick

This commit is contained in:
Armin Friedl 2021-11-01 09:48:01 +01:00
parent d9c786e88c
commit cc590001d7
2 changed files with 14 additions and 6 deletions

View file

@ -35,10 +35,17 @@ impl<'a> Painter<'a> {
ctx.theme_border(&self.theme);
ctx.stroke().unwrap();
// ctx.reset_clip();
// // finally, clip any future content so the border stays alive
self.border_clip();
}
pub fn border_clip(&self)
{
let ctx = self.context;
ctx.reset_clip();
// clip any future content so the border stays alive
let (x1,y1,x2,y2) = ctx.clip_extents().unwrap(); // the path of the clip
// // region, i.e. the surface
// region, i.e. the surface
debug!{"Border extent: {},{},{},{}", x1, y1, x2, y2};
let border = self.theme.border(ctx); // width of the border, note

View file

@ -96,6 +96,7 @@ pub fn redraw_quick(window: &Window, result: Vec<(&Entry, Vec<usize>)>, selectio
context.scale(30.0, 30.0);
let painter = painter::Painter::new(&context);
painter.border_clip();
result.iter().enumerate()
.for_each(|(i, r)| {