Skip to content

Commit

Permalink
egui: Change Ui::allocate_painter to inherit properties from Ui (
Browse files Browse the repository at this point in the history
…#4343)

The painter, allocated by `Ui::allocate_painter`, doesn't inherit
properties from the `Ui` object, leading to improper widget rendering in
`egui`.

Specifically, if the `Ui` object is disabled, the corresponding painter
should also be disabled.
  • Loading branch information
varphone authored Apr 21, 2024
1 parent fe45457 commit 5f9c17c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/egui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ impl Ui {
pub fn allocate_painter(&mut self, desired_size: Vec2, sense: Sense) -> (Response, Painter) {
let response = self.allocate_response(desired_size, sense);
let clip_rect = self.clip_rect().intersect(response.rect); // Make sure we don't paint out of bounds
let painter = Painter::new(self.ctx().clone(), self.layer_id(), clip_rect);
let painter = self.painter().with_clip_rect(clip_rect);
(response, painter)
}

Expand Down

0 comments on commit 5f9c17c

Please sign in to comment.