void OnPointerDown(PointerDownEvent e)
        {
            if (!e.isPrimary || e.button != 0)
            {
                return;
            }

            m_OriginalPointerPosition = this.ChangeCoordinatesTo(parent, e.localPosition);
            m_OriginalElementPosition = m_EdgeModel.EdgeControlPoints[m_ControlPointIndex].Position;
            m_OriginalTightness       = m_EdgeModel.EdgeControlPoints[m_ControlPointIndex].Tightness;

            if (e.modifiers == EventModifiers.None)
            {
                m_DraggingControlPoint = true;
            }
            else if (e.modifiers == EventModifiers.Alt)
            {
                m_DraggingTightness = true;
            }

            if (m_DraggingControlPoint || m_DraggingTightness)
            {
                this.CapturePointer(e.pointerId);
                e.StopPropagation();
            }
        }
예제 #2
0
        void OnPointerDown(PointerDownEvent e)
        {
            if (m_Active)
            {
                e.StopImmediatePropagation();
                return;
            }

            if (CanStartManipulation(e))
            {
                var ve = (e.currentTarget as VisualElement);
                m_Header = ve.GetFirstAncestorOfType <MultiColumnCollectionHeader>();
                preview  = m_Column.collection.resizePreview;

                if (preview)
                {
                    if (m_PreviewElement == null)
                    {
                        m_PreviewElement = new MultiColumnHeaderColumnResizePreview();
                    }

                    VisualElement previewParent = m_Header.GetFirstAncestorOfType <ScrollView>()?.parent ?? m_Header.parent;

                    previewParent.hierarchy.Add(m_PreviewElement);
                }

                columnLayout = m_Header.columnLayout;
                m_Start      = ve.ChangeCoordinatesTo(m_Header, e.localPosition);
                BeginDragResize(m_Start.x);
                m_Active = true;
                target.CaptureMouse();
                e.StopPropagation();
            }
        }
예제 #3
0
 void OnPointerDownEvent(PointerDownEvent evt)
 {
     if (evt.button == (int)MouseButton.LeftMouse)
     {
         if (visualInput.ContainsPoint(visualInput.WorldToLocal(evt.originalMousePosition)))
         {
             ShowMenu();
             evt.StopPropagation();
         }
     }
 }
예제 #4
0
        protected void OnPointerDown(PointerDownEvent e)
        {
            if (m_Active)
            {
                e.StopImmediatePropagation();
                return;
            }

            if (CanStartManipulation(e))
            {
                m_Start = e.localPosition;

                m_Active = true;
                target.CapturePointer(e.pointerId);
                e.StopPropagation();
            }
        }