KASM-1834 disable anti-aliasing when screen ratio is 1:1

This commit is contained in:
matt 2021-09-10 17:31:44 +00:00
parent e0bb9f6bcf
commit 4c8e8ef1e1
2 changed files with 7 additions and 0 deletions

View File

@ -461,6 +461,12 @@ export default class Display {
this._target.style.width = width;
this._target.style.height = height;
}
if (factor === 1 && this._target.style.imageRendering !== 'pixelated') {
this._target.style.imageRendering = 'pixelated';
} else if (factor !== 1 && this._target.style.imageRendering !== 'high-quality') {
this._target.style.imageRendering = 'auto';
}
}
_setFillColor(color) {

View File

@ -225,6 +225,7 @@ export default class RFB extends EventTargetMixin {
this._canvas.style.margin = 'auto';
// Some browsers add an outline on focus
this._canvas.style.outline = 'none';
this._canvas.style.imageRendering = 'pixelated';
this._canvas.width = 0;
this._canvas.height = 0;
this._canvas.tabIndex = -1;