Bug fix: child painters now inherit color tint (e.g. grayed out)

This commit is contained in:
Emil Ernerfeldt 2021-02-20 09:24:25 +01:00
parent 21c99e1130
commit 9c3b7d719b

View file

@ -63,11 +63,12 @@ impl Painter {
/// The clip-rect of the returned `Painter` will be the intersection
/// of the given rectangle and the `clip_rect()` of this `Painter`.
pub fn sub_region(&self, rect: Rect) -> Self {
Self::new(
self.ctx.clone(),
self.layer_id,
rect.intersect(self.clip_rect),
)
Self {
ctx: self.ctx.clone(),
layer_id: self.layer_id,
clip_rect: rect.intersect(self.clip_rect),
fade_to_color: self.fade_to_color,
}
}
}