From d5b84d918564306ce94862b9cc480b75d6b30793 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 11 Jun 2020 16:31:09 +0200 Subject: [PATCH] Avoid fractional pixel sizes from Display --- kasmweb/core/display.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kasmweb/core/display.js b/kasmweb/core/display.js index 332a880..cdb9840 100644 --- a/kasmweb/core/display.js +++ b/kasmweb/core/display.js @@ -8,6 +8,7 @@ import * as Log from './util/logging.js'; import Base64 from "./base64.js"; +import { toSigned32bit } from './util/int.js'; export default class Display { constructor(target) { @@ -184,14 +185,14 @@ export default class Display { if (this._scale === 0) { return 0; } - return x / this._scale + this._viewportLoc.x; + return toSigned32bit(x / this._scale + this._viewportLoc.x); } absY(y) { if (this._scale === 0) { return 0; } - return y / this._scale + this._viewportLoc.y; + return toSigned32bit(y / this._scale + this._viewportLoc.y); } resize(width, height) {