Skip to content

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

Open
@traviskirton

Description

@traviskirton

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions