summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-06-11 16:31:09 +0200
committerPierre Ossman <ossman@cendio.se>2020-06-11 16:50:08 +0200
commit97b86abc948f3f1d5d20864bb4325a0feb6f34bb (patch)
tree43cc509e74570244ea94e560d9e57a7e544421b2
parent0a6aec357850e4681ecfc6cbf74196dc96dbf75b (diff)
downloadnovnc-97b86abc948f3f1d5d20864bb4325a0feb6f34bb.tar.gz
Avoid fractional pixel sizes from Display
-rw-r--r--core/display.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/display.js b/core/display.js
index 7b7f536..cf1a51a 100644
--- a/core/display.js
+++ b/core/display.js
@@ -9,6 +9,7 @@
import * as Log from './util/logging.js';
import Base64 from "./base64.js";
import { supportsImageMetadata } from './util/browser.js';
+import { toSigned32bit } from './util/int.js';
export default class Display {
constructor(target) {
@@ -190,14 +191,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) {