C4iOS icon indicating copy to clipboard operation
C4iOS copied to clipboard

Rotation property doesn't get applied when set in `setup()`

Open traviskirton opened this issue 8 years ago • 0 comments

The following works:

override func setup() {
    let r = Rectangle(frame: Rect(0, 0, 200, 200))
    r.lineWidth = 15.0

    let c = Circle(center: Point(), radius: 25)
    c.lineWidth = 5.0

    r.add(c)

    r.center = canvas.center

    canvas.add(r)

    wait(0.001) {
        r.rotation += 1.75 * M_PI
    }
}

Resulting in:

simulator screen shot may 16 2016 4 42 34 pm

However, the following has no effect...

override func setup() {
    let r = Rectangle(frame: Rect(0, 0, 200, 200))
    r.lineWidth = 15.0

    let c = Circle(center: Point(), radius: 25)
    c.lineWidth = 5.0

    r.add(c)

    r.center = canvas.center

    canvas.add(r)

    r.rotation += 1.75 * M_PI
}

Resulting in:

simulator screen shot may 16 2016 4 42 20 pm

traviskirton avatar May 16 '16 23:05 traviskirton