From 9c3b7d719beb198e11a4c72bf200f07672a758be Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 20 Feb 2021 09:24:25 +0100 Subject: [PATCH] Bug fix: child painters now inherit color tint (e.g. grayed out) --- egui/src/painter.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/egui/src/painter.rs b/egui/src/painter.rs index acd83880..519c22cd 100644 --- a/egui/src/painter.rs +++ b/egui/src/painter.rs @@ -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, + } } }