mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-14 12:58:39 -09:00
Add a slight timeout to update the fontSmoothing pref (#407)
This seems like a bug with chrome/electron where the devicePixelRatio value doesn't update right away. It's probably in the event loop, so adding a short timeout should solve this problem.
This commit is contained in:
parent
063045a829
commit
7e889dd509
1 changed files with 11 additions and 7 deletions
|
|
@ -60,14 +60,18 @@ export function resetFontSize () {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setFontSmoothing () {
|
export function setFontSmoothing () {
|
||||||
const devicePixelRatio = window.devicePixelRatio;
|
return (dispatch) => {
|
||||||
const fontSmoothing = devicePixelRatio < 2
|
setTimeout(() => {
|
||||||
? 'subpixel-antialiased'
|
const devicePixelRatio = window.devicePixelRatio;
|
||||||
: 'antialiased';
|
const fontSmoothing = devicePixelRatio < 2
|
||||||
|
? 'subpixel-antialiased'
|
||||||
|
: 'antialiased';
|
||||||
|
|
||||||
return {
|
dispatch({
|
||||||
type: UI_FONT_SMOOTHING_SET,
|
type: UI_FONT_SMOOTHING_SET,
|
||||||
fontSmoothing
|
fontSmoothing
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue