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),