1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

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

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