mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -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.
|
/// Convert coverage to alpha.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn alpha_from_coverage(&self, coverage: f32) -> f32 {
|
pub fn alpha_from_coverage(&self, coverage: f32) -> f32 {
|
||||||
|
let coverage = coverage.clamp(0.0, 1.0);
|
||||||
match self {
|
match self {
|
||||||
Self::Linear => coverage,
|
Self::Linear => coverage,
|
||||||
Self::Gamma(gamma) => coverage.powf(*gamma),
|
Self::Gamma(gamma) => coverage.powf(*gamma),
|
||||||
|
|||||||
Reference in New Issue
Block a user