public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf) { if (m_Type != di.type || (di.type == DropInfo.Type.Pane && di.rect != m_TargetRect)) { m_Type = di.type; switch (di.type) { case DropInfo.Type.Window: m_TargetAlpha = 0.6f; break; case DropInfo.Type.Pane: case DropInfo.Type.Tab: m_TargetAlpha = 1.0f; break; } } switch (di.type) { case DropInfo.Type.Window: m_TargetRect = new Rect(mouseScreenPos.x - m_FullWindowSize.x / 2, mouseScreenPos.y - m_FullWindowSize.y / 2, m_FullWindowSize.x, m_FullWindowSize.y); break; case DropInfo.Type.Pane: case DropInfo.Type.Tab: m_TargetRect = di.rect; break; } m_TabVisible = di.type == DropInfo.Type.Tab; m_TargetRect.x = Mathf.Round(m_TargetRect.x); m_TargetRect.y = Mathf.Round(m_TargetRect.y); m_TargetRect.width = Mathf.Round(m_TargetRect.width); m_TargetRect.height = Mathf.Round(m_TargetRect.height); m_InFrontOfWindow = inFrontOf; m_Window.MoveInFrontOf(m_InFrontOfWindow); // On Windows, repainting without setting proper size first results in one garbage frame... For some reason. SetWindowPos(m_TargetRect); // Yes, repaint. Repaint(); }