Author
Travis Kirton


Line Width

This example puts a little pow into the width of lines.

Example

var points = (Point(), Point(canvas.width, 0))

var step = 0.0
repeat {
    let width = pow(1.1, step)
    //shift the line points based on the current line width (with a little gap)
    let dy = Vector(x: 0, y: width+1)
    points.0 += dy
    points.1 += dy

    let newLine = Line(points)
    newLine.lineWidth = width
    canvas.add(newLine)
    step += 1.0
}