AuthorTravis Kirton
Tags views, transform
Before applying a transform to a view, you can append other transforms to it.
var t = Transform.makeScale(2, 2) t.rotate(M_PI) t.translate(Vector(10,10)) view.transform = t
let img = Image("chop")! canvas.add(img) let dw = canvas.width/img.width let dxdy = (Vector(img.center) - Vector(canvas.center))/dw var scaleRotateTranslate = Transform.makeScale(dw, dw) scaleRotateTranslate.rotate(M_PI) scaleRotateTranslate.translate(dxdy) let a = ViewAnimation(duration: 1.0) { img.transform = scaleRotateTranslate } a.delay = 1.0 a.animate()