summaryrefslogtreecommitdiff
path: root/kvmd/web/js/mouse.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-08-06 21:25:41 +0300
committerDevaev Maxim <[email protected]>2018-08-06 21:25:41 +0300
commitf45efdf2fc1a49341bd7dc88c804b9eea5b1f775 (patch)
tree3c5472f2254cc932eb14f5c53cc7b550c515bba3 /kvmd/web/js/mouse.js
parentff29d85faf8e8d414006a173b29b4eaf2bceab84 (diff)
adjustable stream size
Diffstat (limited to 'kvmd/web/js/mouse.js')
-rw-r--r--kvmd/web/js/mouse.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/kvmd/web/js/mouse.js b/kvmd/web/js/mouse.js
index ba4eb264..d02762e4 100644
--- a/kvmd/web/js/mouse.js
+++ b/kvmd/web/js/mouse.js
@@ -71,15 +71,16 @@ var mouse = new function() {
var __sendMove = function() {
var pos = __current_pos;
if (pos.x !== __sent_pos.x || pos.y !== __sent_pos.y) {
- tools.debug("Mouse move:", pos);
+ el_stream_image = $("stream-image");
+ var to = {
+ x: __translate(pos.x, 0, el_stream_image.clientWidth, -32768, 32767),
+ y: __translate(pos.y, 0, el_stream_image.clientHeight, -32768, 32767),
+ };
+ tools.debug("Mouse move:", to);
if (__ws) {
- el_stream_image = $("stream-image");
__ws.send(JSON.stringify({
event_type: "mouse_move",
- to: {
- x: __translate(pos.x, 0, el_stream_image.clientWidth, -32768, 32767),
- y: __translate(pos.y, 0, el_stream_image.clientHeight, -32768, 32767),
- },
+ to: to,
}));
}
__sent_pos = pos;