Browse Source

bugfix with x/y s2d offset

ncannasse 9 years ago
parent
commit
c7ff0473c7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      h2d/Scene.hx

+ 2 - 2
h2d/Scene.hx

@@ -90,11 +90,11 @@ class Scene extends Layers implements h3d.IDrawable {
 	}
 
 	function screenXToLocal(mx:Float) {
-		return (mx - x) * width / (stage.width * scaleX);
+		return mx * width / (stage.width * scaleX) - x;
 	}
 
 	function screenYToLocal(my:Float) {
-		return (my - y) * height / (stage.height * scaleY);
+		return my * height / (stage.height * scaleY) - y;
 	}
 
 	function get_mouseX() {