Browse Source

Replace experimental property which did not work in Firefox.

Bentley James Oakes 7 years ago
parent
commit
66c94e96e2
1 changed files with 6 additions and 16 deletions
  1. 6 16
      client/gui_utils.js

+ 6 - 16
client/gui_utils.js

@@ -15,26 +15,16 @@ GUIUtils = function(){
 	/**
 	 * Converts from page centric X coordinates to canvas centric X coordinates
 	 */
-	this.convertToCanvasX = function(event){
-
-		//experimental property
-		return event.offsetX;
-
-		//breaks when page is scrolled
-		//return event.pageX + $('#div_container').scrollLeft() - $('#contentDiv').offset().left;
-	};
+    this.convertToCanvasX = function (event) {
+        return event.layerX;
+    };
 
 	/**
 	 * Converts from page centric Y coordinates to canvas centric Y coordinates
 	 */
-	this.convertToCanvasY = function(event){
-
-		//experimental property
-		return event.offsetY;
-
-		//breaks when page is scrolled
-		//return event.pageY + $('#div_container').scrollTop() - $('#contentDiv').offset().top;
-	};
+    this.convertToCanvasY = function (event) {
+        return event.layerY;
+    };
 	
 	/**
 	 * Disables the dock bar