Skip to content

Commit

Permalink
Fix visual artifact with thin rounded rectangles
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 9, 2023
1 parent 3b339e7 commit b79503d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/egui_demo_lib/src/demo/misc_demo_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl BoxPainting {
ui.painter().rect(
rect,
self.rounding,
Color32::from_gray(64),
ui.visuals().text_color().gamma_multiply(0.5),
Stroke::new(self.stroke_width, Color32::WHITE),
);
}
Expand Down
1 change: 1 addition & 0 deletions crates/epaint/src/tessellator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ pub mod path {
add_circle_quadrant(path, pos2(min.x + r.sw, max.y - r.sw), r.sw, 1.0);
add_circle_quadrant(path, pos2(min.x + r.nw, min.y + r.nw), r.nw, 2.0);
add_circle_quadrant(path, pos2(max.x - r.ne, min.y + r.ne), r.ne, 3.0);
path.dedup(); // We get duplicates for thin rectangles, producing visual artifats
}
}

Expand Down

0 comments on commit b79503d

Please sign in to comment.