Ejemplo n.º 1
0
 void OnPointerCaptureOut(PointerCaptureOutEvent evt)
 {
     if (!m_Active)
     {
         return;
     }
     CancelDrag(evt.originalMousePosition);
 }
        public void ProcessPointerCapture(int pointerId)
        {
            if (m_PointerCapture[pointerId] == m_PendingPointerCapture[pointerId])
            {
                return;
            }

            if (m_PointerCapture[pointerId] != null)
            {
                using (var e =
                           PointerCaptureOutEvent.GetPooled(m_PointerCapture[pointerId], m_PendingPointerCapture[pointerId], pointerId))
                {
                    m_PointerCapture[pointerId].SendEvent(e);
                }

                if (pointerId == PointerId.mousePointerId)
                {
                    using (var e =
                               MouseCaptureOutEvent.GetPooled(m_PointerCapture[pointerId], m_PendingPointerCapture[pointerId], pointerId))
                    {
                        m_PointerCapture[pointerId].SendEvent(e);
                    }
                }
            }

            if (m_PendingPointerCapture[pointerId] != null)
            {
                using (var e =
                           PointerCaptureEvent.GetPooled(m_PendingPointerCapture[pointerId], m_PointerCapture[pointerId], pointerId))
                {
                    m_PendingPointerCapture[pointerId].SendEvent(e);
                }

                if (pointerId == PointerId.mousePointerId)
                {
                    using (var e =
                               MouseCaptureEvent.GetPooled(m_PendingPointerCapture[pointerId], m_PointerCapture[pointerId], pointerId))
                    {
                        m_PendingPointerCapture[pointerId].SendEvent(e);
                    }
                }
            }

            m_PointerCapture[pointerId] = m_PendingPointerCapture[pointerId];
        }