Explorar o código

bugfix with x/y s2d offset

ncannasse %!s(int64=9) %!d(string=hai) anos
pai
achega
c7ff0473c7
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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) {
 	function screenXToLocal(mx:Float) {
-		return (mx - x) * width / (stage.width * scaleX);
+		return mx * width / (stage.width * scaleX) - x;
 	}
 	}
 
 
 	function screenYToLocal(my:Float) {
 	function screenYToLocal(my:Float) {
-		return (my - y) * height / (stage.height * scaleY);
+		return my * height / (stage.height * scaleY) - y;
 	}
 	}
 
 
 	function get_mouseX() {
 	function get_mouseX() {