瀏覽代碼

Fix lime stage widht/height on iOS retina

Pascal Peridont 9 年之前
父節點
當前提交
990b51fa53
共有 2 個文件被更改,包括 7 次插入5 次删除
  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);
 	}