mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user