From 68b3ef7f6badfe893d3bbb1f791b481069d807d9 Mon Sep 17 00:00:00 2001 From: vincent-sparks <155431337+vincent-sparks@users.noreply.github.com> Date: Sun, 18 Feb 2024 04:25:11 -0800 Subject: [PATCH] Fix: images with background color now respects rounding (#4029) Co-authored-by: Vincent Sparks Co-authored-by: Emil Ernerfeldt --- crates/egui/src/widgets/image.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/egui/src/widgets/image.rs b/crates/egui/src/widgets/image.rs index d055fee3..1d1ec581 100644 --- a/crates/egui/src/widgets/image.rs +++ b/crates/egui/src/widgets/image.rs @@ -739,9 +739,7 @@ pub fn paint_texture_at( texture: &SizedTexture, ) { if options.bg_fill != Default::default() { - let mut mesh = Mesh::default(); - mesh.add_colored_rect(rect, options.bg_fill); - painter.add(Shape::mesh(mesh)); + painter.add(RectShape::filled(rect, options.rounding, options.bg_fill)); } match options.rotation {