protected override void OldOnGUI()
{
if (Event.current.type != EventType.Repaint)
{
return;
}
const float dragTabOffsetX = 2f;
const float dragTabOffsetY = 2f;
const float dragTabHeight = 18f;
float minWidth, expectedWidth;
Styles.dragtab.CalcMinMaxWidth(m_Content, out minWidth, out expectedWidth);
float tabWidth = Mathf.Max(Mathf.Min(expectedWidth, Styles.tabMaxWidth), Styles.tabMinWidth) + Styles.tabWidthPadding;
Rect windowRect = new Rect(0, 0, position.width, position.height);
Rect tabPositionRect = new Rect(dragTabOffsetX, dragTabOffsetY, tabWidth, dragTabHeight);
float roundedPosX = Mathf.Round(tabPositionRect.x);
float roundedWidth = Mathf.Round(tabPositionRect.x + tabPositionRect.width) - roundedPosX;
Rect tabContentRect = new Rect(roundedPosX, tabPositionRect.y, roundedWidth, tabPositionRect.height);
Rect viewRect = new Rect(dragTabOffsetX, tabContentRect.yMax - 2f,
position.width - dragTabOffsetX * 2, position.height - tabContentRect.yMax - dragTabOffsetY + 2f);
Styles.background.Draw(windowRect, GUIContent.none, false, false, true, true);
Styles.dragtab.Draw(tabContentRect, false, true, false, false);
Styles.view.Draw(viewRect, GUIContent.none, false, false, true, true);
GUI.Label(tabPositionRect, m_Content, Styles.tabLabel);
// We currently only support this on macOS
m_Window.SetAlpha(m_TargetAlpha);
}