瀏覽代碼

Fix dialog centering in the editor to use UI root size instead of screen size, which may not be the same.

Lasse Öörni 8 年之前
父節點
當前提交
5fecffe8bd
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bin/Data/Scripts/Editor/EditorUI.as

+ 1 - 1
bin/Data/Scripts/Editor/EditorUI.as

@@ -1114,7 +1114,7 @@ void CreateDebugHud()
 void CenterDialog(UIElement@ element)
 {
     IntVector2 size = element.size;
-    element.SetPosition((graphics.width - size.x) / 2, (graphics.height - size.y) / 2);
+    element.SetPosition((ui.root.width - size.x) / 2, (ui.root.height - size.y) / 2);
 }
 
 void CreateContextMenu()