示例#1
0
        internal void UpdateElementUnderPointers()
        {
            foreach (var pointerId in PointerId.hoveringPointers)
            {
                if (PointerDeviceState.GetPanel(pointerId) != this)
                {
                    SetElementUnderPointer(null, pointerId);
                }
                else
                {
                    VisualElement elementUnderPointer = Pick(PointerDeviceState.GetPointerPosition(pointerId));
                    SetElementUnderPointer(elementUnderPointer, pointerId);
                }
            }

            CommitElementUnderPointers();
        }
示例#2
0
        internal void UpdateElementUnderPointers()
        {
            foreach (var pointerId in PointerId.hoveringPointers)
            {
                if (PointerDeviceState.GetPanel(pointerId) != this)
                {
                    SetElementUnderPointer(null, pointerId, new Vector2(float.MinValue, float.MinValue));
                }
                else
                {
                    var pointerPos = PointerDeviceState.GetPointerPosition(pointerId);
                    // Here it's important to call PickAll instead of Pick to ensure we don't use the cached value.
                    VisualElement elementUnderPointer = PickAll(pointerPos, null);
                    SetElementUnderPointer(elementUnderPointer, pointerId, pointerPos);
                }
            }

            CommitElementUnderPointers();
        }
 internal void UpdateElementUnderPointers()
 {
     int[] hoveringPointers = PointerId.hoveringPointers;
     for (int i = 0; i < hoveringPointers.Length; i++)
     {
         int  pointerId = hoveringPointers[i];
         bool flag      = PointerDeviceState.GetPanel(pointerId) != this;
         if (flag)
         {
             this.SetElementUnderPointer(null, pointerId, new Vector2(-3.40282347E+38f, -3.40282347E+38f));
         }
         else
         {
             Vector2       pointerPosition        = PointerDeviceState.GetPointerPosition(pointerId);
             VisualElement newElementUnderPointer = this.PickAll(pointerPosition, null);
             this.SetElementUnderPointer(newElementUnderPointer, pointerId, pointerPosition);
         }
     }
     this.CommitElementUnderPointers();
 }