From 078b7b80924d3abfa1f98b139ba4750fa3c2540e Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 23 Jan 2012 13:48:30 -0800 Subject: [PATCH] Round to nearest tenth, rather than integer. --- src/main/resources/oskeyboard.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/oskeyboard.js b/src/main/resources/oskeyboard.js index b329f65..91f3241 100644 --- a/src/main/resources/oskeyboard.js +++ b/src/main/resources/oskeyboard.js @@ -81,11 +81,11 @@ Guacamole.OnScreenKeyboard = function(url) { this.height = height; this.scale = function(pixels) { - element.style.width = Math.floor(width * pixels) + "px"; - element.style.height = Math.floor(height * pixels) + "px"; + element.style.width = (width * pixels) + "px"; + element.style.height = (height * pixels) + "px"; if (scaleFont) { - element.style.lineHeight = Math.floor(height * pixels) + "px"; + element.style.lineHeight = (height * pixels) + "px"; element.style.fontSize = pixels + "px"; } } @@ -369,7 +369,7 @@ Guacamole.OnScreenKeyboard = function(url) { this.resize = function(width) { // Get pixel size of a unit - var unit = Math.floor(width / keyboard_size); + var unit = Math.floor(width * 10 / keyboard_size) / 10; // Resize all scaled elements for (var i=0; i