Fix glyph rendering: clamp coverage to [0, 1] (#7415)

* Closes  #7366
* Closes https://github.com/emilk/egui/pull/7388
This commit is contained in:
Emil Ernerfeldt 2025-08-05 13:03:39 +02:00 committed by GitHub
parent c38d38e89d
commit b9a5081490
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

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