Browse Source

Fix lime stage widht/height on iOS retina

Pascal Peridont 9 years ago
parent
commit
990b51fa53
2 changed files with 7 additions and 5 deletions
  1. 4 2
      hxd/System.hx
  2. 3 3
      hxd/impl/LimeStage.hx

+ 4 - 2
hxd/System.hx

@@ -270,11 +270,13 @@ class System {
 	}
 
 	static function get_width() {
-		return lime.app.Application.current.window.width;
+		var win = lime.app.Application.current.window;
+		return Std.int(win.width * win.scale);
 	}
 
 	static function get_height() {
-		return lime.app.Application.current.window.height;
+		var win = lime.app.Application.current.window;
+		return Std.int(win.height * win.scale);
 	}
 
 	static function get_isAndroid() {

+ 3 - 3
hxd/impl/LimeStage.hx

@@ -27,9 +27,9 @@ class LimeStage implements lime.app.IModule {
 			hxd.System.loopFunc();
 	}
 
-	public function onWindowResize(win, w, h){
-		width = w;
-		height = h;
+	public function onWindowResize(win:lime.ui.Window, w, h){
+		width = Std.int(w * win.scale);
+		height = Std.int(h * win.scale);
 		stage.onResize(null);
 	}