Browse Source

Merge pull request #763 from stevehalliwell/CommandSearchHeightFallback

Fallback for Command Search Popup height
master
Steve Halliwell 5 years ago committed by GitHub
parent
commit
ab154ca843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Assets/Fungus/Scripts/Editor/BlockEditor.cs

8
Assets/Fungus/Scripts/Editor/BlockEditor.cs

@ -319,9 +319,15 @@ namespace Fungus.EditorUtils
// Add Button // Add Button
if (GUILayout.Button(addIcon)) if (GUILayout.Button(addIcon))
{ {
//this may be less reliable for HDPI scaling but previous method using editor window height is now returning
// null in 2019.2 suspect ongoing ui changes, so default to screen.height and then attempt to get the better result
int h = Screen.height;
if (EditorWindow.focusedWindow != null) h = (int)EditorWindow.focusedWindow.position.height;
else if (EditorWindow.mouseOverWindow != null) h = (int)EditorWindow.mouseOverWindow.position.height;
CommandSelectorPopupWindowContent.ShowCommandMenu(lastCMDpopupPos, "", target as Block, CommandSelectorPopupWindowContent.ShowCommandMenu(lastCMDpopupPos, "", target as Block,
(int)(EditorGUIUtility.currentViewWidth), (int)(EditorGUIUtility.currentViewWidth),
(int)(EditorWindow.focusedWindow.position.height - lastCMDpopupPos.y)); (int)(h - lastCMDpopupPos.y));
} }
// Duplicate Button // Duplicate Button

Loading…
Cancel
Save