From 4c8e8ef1e1b0bf0000438cfb27a7447c24d71747 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 10 Sep 2021 17:31:44 +0000 Subject: [PATCH 1/2] KASM-1834 disable anti-aliasing when screen ratio is 1:1 --- core/display.js | 6 ++++++ core/rfb.js | 1 + 2 files changed, 7 insertions(+) diff --git a/core/display.js b/core/display.js index 5a6644d9..a53eb0df 100644 --- a/core/display.js +++ b/core/display.js @@ -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) { diff --git a/core/rfb.js b/core/rfb.js index cf9cccaf..41b94f07 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -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; From 6b283b23138f39e3f67da32997ba97f7114b6da6 Mon Sep 17 00:00:00 2001 From: mmcclaskey Date: Fri, 10 Sep 2021 13:41:03 -0400 Subject: [PATCH 2/2] Update display.js --- core/display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/display.js b/core/display.js index a53eb0df..2e1eff83 100644 --- a/core/display.js +++ b/core/display.js @@ -464,7 +464,7 @@ export default class Display { if (factor === 1 && this._target.style.imageRendering !== 'pixelated') { this._target.style.imageRendering = 'pixelated'; - } else if (factor !== 1 && this._target.style.imageRendering !== 'high-quality') { + } else if (factor !== 1 && this._target.style.imageRendering !== 'auto') { this._target.style.imageRendering = 'auto'; } }