Exemple #1
0
    public List<Vector2> ScaleTo(float size)
    {
        Rect boundingBox = Gesture.GetBoundingBox(this.Points);
        List<Vector2> scaledPoints = new List<Vector2>();

        for (int i = 0; i < this.Points.Count; i++)
        {
            float x = this.Points[i].x * (size / boundingBox.width);
            float y = this.Points[i].y * (size / boundingBox.height);
            scaledPoints.Add(new Vector2(x, y));
        }

        return scaledPoints;
    }