mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
No issue - Set device contrast to an acceptable value if OOB.
On Mac and Win+DW, enhanced device contrast can possibly not be set. This throws Skia for a loop by passing in an OOB scalar to its init. Work around this by setting an accepted average value that helps prevent font wash-out while not causing fringing.
This commit is contained in:
@@ -73,8 +73,11 @@ struct SkScalerContextRec {
|
||||
return SkIntToScalar(fContrast) / ((1 << 8) - 1);
|
||||
}
|
||||
void setContrast(SkScalar c) {
|
||||
SkASSERT(0 <= c && c <= SK_Scalar1);
|
||||
fContrast = SkScalarRoundToInt(c * ((1 << 8) - 1));
|
||||
if (0 <= c && c <= SK_Scalar1) {
|
||||
fContrast = SkScalarRoundToInt(c * ((1 << 8) - 1));
|
||||
} else {
|
||||
fContrast = SkScalarRoundToInt(0.5f * ((1 << 8) - 1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user