void OnPointerMove(PointerMoveEvent e) { VseGraphView graphView = null; Vector2 pointerDelta = Vector2.zero; if (m_DraggingControlPoint || m_DraggingTightness) { graphView = GetFirstAncestorOfType <VseGraphView>(); var pointerPosition = this.ChangeCoordinatesTo(parent, e.localPosition); pointerDelta = new Vector2(pointerPosition.x, pointerPosition.y) - m_OriginalPointerPosition; } if (graphView == null) { return; } if (m_DraggingControlPoint) { var newPosition = m_OriginalElementPosition + pointerDelta; graphView.store.Dispatch(new MoveEdgeControlPointAction(m_EdgeModel, m_ControlPointIndex, newPosition, m_OriginalTightness)); m_EdgeControl.MarkDirtyRepaint(); e.StopPropagation(); } else if (m_DraggingTightness) { var tightnessDelta = pointerDelta.x - pointerDelta.y; var newTightness = m_OriginalTightness + tightnessDelta; graphView.store.Dispatch(new MoveEdgeControlPointAction(m_EdgeModel, m_ControlPointIndex, m_OriginalElementPosition, newTightness)); e.StopPropagation(); m_EdgeControl.MarkDirtyRepaint(); } }
void OnPointerMove(PointerMoveEvent evt) { if (!m_Panning) { return; } Vector2 deltaPosition = evt.deltaPosition; m_Viewport.contentOffset += deltaPosition; evt.StopPropagation(); }
void OnPointerMove(PointerMoveEvent e) { if (!m_Active || !target.HasPointerCapture(e.pointerId)) { return; } var ve = (e.currentTarget as VisualElement); var pos = ve.ChangeCoordinatesTo(m_Header, e.localPosition); DragResize(pos.x); e.StopPropagation(); }
protected void OnPointerMove(PointerMoveEvent e) { if (!m_Active || !target.HasPointerCapture(e.pointerId)) { return; } Vector2 diff = e.localPosition - m_Start; var mouseDiff = diff.x; if (orientation == TwoPaneSplitViewOrientation.Vertical) { mouseDiff = diff.y; } var delta = m_Direction * mouseDiff; ApplyDelta(delta); e.StopPropagation(); }