From b9a5081490f4349598ecb833784d391dd2d43488 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 5 Aug 2025 13:03:39 +0200 Subject: [PATCH] Fix glyph rendering: clamp coverage to [0, 1] (#7415) * Closes #7366 * Closes https://github.com/emilk/egui/pull/7388 --- crates/epaint/src/image.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/epaint/src/image.rs b/crates/epaint/src/image.rs index e14ea869..059d9d76 100644 --- a/crates/epaint/src/image.rs +++ b/crates/epaint/src/image.rs @@ -384,6 +384,7 @@ impl AlphaFromCoverage { /// Convert coverage to alpha. #[inline(always)] pub fn alpha_from_coverage(&self, coverage: f32) -> f32 { + let coverage = coverage.clamp(0.0, 1.0); match self { Self::Linear => coverage, Self::Gamma(gamma) => coverage.powf(*gamma),