UnityEditor.PopupLocationHelper.FitRect C# (CSharp) Method

FitRect() private static method

private static FitRect ( Rect rect, ContainerWindow popupContainerWindow ) : Rect
rect UnityEngine.Rect
popupContainerWindow ContainerWindow
return UnityEngine.Rect
        private static Rect FitRect(Rect rect, ContainerWindow popupContainerWindow)
        {
            if (popupContainerWindow != null)
            {
                return popupContainerWindow.FitWindowRectToScreen(rect, true, true);
            }
            return ContainerWindow.FitRectToScreen(rect, true, true);
        }

Usage Example

示例#1
0
        private static bool PopupRight(Rect buttonRect, Vector2 minSize, Vector2 maxSize, ContainerWindow popupContainerWindow, out Rect resultRect)
        {
            Rect  rect1 = new Rect(buttonRect.xMax, buttonRect.y, maxSize.x, maxSize.y);
            float num   = 0.0f;

            rect1.xMax   += num;
            rect1.height += PopupLocationHelper.k_SpaceFromBottom;
            Rect  rect2 = PopupLocationHelper.FitRect(rect1, popupContainerWindow);
            float a     = Mathf.Max(rect2.xMax - buttonRect.xMax - num, 0.0f);
            float width = Mathf.Min(a, maxSize.x);

            resultRect = new Rect(rect2.x, rect2.y, width, rect2.height - PopupLocationHelper.k_SpaceFromBottom);
            return((double)a >= (double)minSize.x);
        }
All Usage Examples Of UnityEditor.PopupLocationHelper::FitRect