Paint.ToolBox.CheckTouchCollision C# (CSharp) Méthode

CheckTouchCollision() public méthode

Checks wheter a particular touch point (user pressing the screen) is within the bounds of one of the tools.
public CheckTouchCollision ( ITouchPoint touchPosition ) : bool
touchPosition ITouchPoint
Résultat bool
        public bool CheckTouchCollision(ITouchPoint touchPosition)
        {
            foreach (var tool in this.interactiveTools)
            {
                // If the tool is not fully on screen then don't check for a collision
                // (This happens when controls are hidden because the toolbox is minimized - however
                //  we perform this check because there is an overlap on the borders which means we
                //  might otherwise accidentally select a hidden tool)
                if (tool.Bounds.Bottom < this.ToolboxHeight &&
                    tool.CheckTouchCollision(touchPosition) == true)
                {
                    // no need to check the other tools so exit now
                    return true;
                }
            }

            return false;
        }