Fix glyph rendering: clamp coverage to [0, 1] (#7415)
* Closes #7366 * Closes https://github.com/emilk/egui/pull/7388
This commit is contained in:
parent
c38d38e89d
commit
b9a5081490
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue