Merge pull request #13 from kasmtech/feature/KASM-1834_high_dpi_2

KASM-1834 disable anti-aliasing when screen ratio is 1:1, Fixes blurry screen on high DPI monitors. Smoothing is not needed when the resolution on the client and server are 1 to 1
This commit is contained in:
mmcclaskey 2021-09-10 13:42:53 -04:00 committed by GitHub
commit d1e4bda4b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 !== 'auto') {
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;