Paint.BaseGame.ConvertScreenTouchToCanvasTouch C# (CSharp) Méthode

ConvertScreenTouchToCanvasTouch() protected méthode

Converts the screen touchpoint to a canvas touchpoint - i.e. alters the position of the touch to take into account the position and size of the toolbox
protected ConvertScreenTouchToCanvasTouch ( TouchPointSizeColour screenTouchPoint ) : TouchPointSizeColour
screenTouchPoint TouchPointSizeColour
Résultat TouchPointSizeColour
        protected TouchPointSizeColour ConvertScreenTouchToCanvasTouch(TouchPointSizeColour screenTouchPoint)
        {
            if (this.ToolBox.DockPosition == DockPosition.Top)
            {
                Vector2 offsetPosition = new Vector2(screenTouchPoint.Position.X, screenTouchPoint.Position.Y - this.ToolBox.ToolboxMinimizedHeight);
                return new TouchPointSizeColour(
                    offsetPosition,
                    screenTouchPoint.TouchType,
                    screenTouchPoint.Color,
                    screenTouchPoint.Size);
            }

            return screenTouchPoint;
        }