Fixed initial draw location for new cursors
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Wed, 18 May 2011 21:24:45 +0000 (14:24 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Wed, 18 May 2011 21:24:45 +0000 (14:24 -0700)
src/main/resources/guacamole.js

index 5ab4e89..ead5484 100644 (file)
@@ -307,12 +307,14 @@ function GuacamoleClient(display, tunnel) {
             var image = new Image();
             image.onload = function() {
                 cursorImage = image;
+
+                var cursorX = cursorRectX + cursorHotspotX;
+                var cursorY = cursorRectY + cursorHotspotY;
+
                 cursorHotspotX = x;
                 cursorHotspotY = y;
-                redrawCursor(
-                    cursorRectX + cursorHotspotX,
-                    cursorRectY + cursorHotspotY
-                );
+
+                redrawCursor(cursorX, cursorY);
             };
             image.src = "data:image/png;base64," + data