void OnPointerDown(PointerDownEvent evt) { m_MousePosition = m_ScrollView.WorldToLocal(evt.position); UpdateSelection(evt.target as VisualElement); if (evt.pointerId != PointerId.mousePointerId) { m_MenuContainer.panel.PreventCompatibilityMouseEvents(evt.pointerId); } evt.StopPropagation(); }
private void OnPointerDown(PointerDownEvent evt) { bool flag = evt.pointerType != PointerType.mouse && evt.isPrimary && this.m_ScrollingPointerId == PointerId.invalidPointerId; if (flag) { IVisualElementScheduledItem expr_39 = this.m_PostPointerUpAnimation; if (expr_39 != null) { expr_39.Pause(); } this.m_ScrollingPointerId = evt.pointerId; this.m_PointerStartPosition = evt.position; this.m_StartPosition = this.scrollOffset; this.m_Velocity = Vector2.zero; this.m_SpringBackVelocity = Vector2.zero; this.m_LowBounds = new Vector2(Mathf.Min(this.horizontalScroller.lowValue, this.horizontalScroller.highValue), Mathf.Min(this.verticalScroller.lowValue, this.verticalScroller.highValue)); this.m_HighBounds = new Vector2(Mathf.Max(this.horizontalScroller.lowValue, this.horizontalScroller.highValue), Mathf.Max(this.verticalScroller.lowValue, this.verticalScroller.highValue)); evt.StopPropagation(); } }
void OnPointerDown(PointerDownEvent evt) { if (evt.pointerType != PointerType.mouse && evt.isPrimary && m_ScrollingPointerId == PointerId.invalidPointerId) { m_PostPointerUpAnimation?.Pause(); m_ScrollingPointerId = evt.pointerId; m_PointerStartPosition = evt.position; m_StartPosition = scrollOffset; m_Velocity = Vector2.zero; m_SpringBackVelocity = Vector2.zero; m_LowBounds = new Vector2( Mathf.Min(horizontalScroller.lowValue, horizontalScroller.highValue), Mathf.Min(verticalScroller.lowValue, verticalScroller.highValue)); m_HighBounds = new Vector2( Mathf.Max(horizontalScroller.lowValue, horizontalScroller.highValue), Mathf.Max(verticalScroller.lowValue, verticalScroller.highValue)); evt.StopPropagation(); } }