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(); } }
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(); } }
void OnPointerDownEvent(PointerDownEvent evt) { if (evt.button == (int)MouseButton.LeftMouse) { if (visualInput.ContainsPoint(visualInput.WorldToLocal(evt.originalMousePosition))) { ShowMenu(); evt.StopPropagation(); } } }
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(); } }