mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09: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:
parent
75c0461123
commit
91a026ea65
1 changed files with 5 additions and 2 deletions
|
|
@ -73,8 +73,11 @@ struct SkScalerContextRec {
|
||||||
return SkIntToScalar(fContrast) / ((1 << 8) - 1);
|
return SkIntToScalar(fContrast) / ((1 << 8) - 1);
|
||||||
}
|
}
|
||||||
void setContrast(SkScalar c) {
|
void setContrast(SkScalar c) {
|
||||||
SkASSERT(0 <= c && c <= SK_Scalar1);
|
if (0 <= c && c <= SK_Scalar1) {
|
||||||
fContrast = SkScalarRoundToInt(c * ((1 << 8) - 1));
|
fContrast = SkScalarRoundToInt(c * ((1 << 8) - 1));
|
||||||
|
} else {
|
||||||
|
fContrast = SkScalarRoundToInt(0.5f * ((1 << 8) - 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue