You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting started and making some tests. I haven't been able to find out what I am missing in this case.
Just tried to setup a simple scene interested only on the relative positions, expecting that the SVGView would apply the selected contentMode, scalling and filling in my view.
And all is rendered as expected while the animation is stopped, but, when it begins my animated rect looks like if it hasn't been transformed by the View and its contentMode.
Actually there are two things with the current release version:
There is SVGView which is not intended to be used with a custom node. It's designed for selecting SVG from the storyboard. But it's support contentMode.
There is MacawView which you can use with any node, but it's not support contentMode.
However we fixed this issue in the master branch and it will be part of the next release (coming very soon). Now you can use MacawView and it supports contentMode. So please use master version or wait a little bit for the next release.
/*
Hi there,
Before anything, excellent library!
Getting started and making some tests. I haven't been able to find out what I am missing in this case.
Just tried to setup a simple scene interested only on the relative positions, expecting that the SVGView would apply the selected contentMode, scalling and filling in my view.
And all is rendered as expected while the animation is stopped, but, when it begins my animated rect looks like if it hasn't been transformed by the View and its contentMode.
Thank you !
*/
let backg = Rect(x: 0, y: 0, w: 60, h: 60).fill(with: Color.black)
let rect = Group(
contents: [
Line(x1: 0, y1: 0, x2: 20, y2: 0).stroke(fill: Color.blue, width: 3, cap: .round),
Line(x1: 0, y1: 20, x2: 20, y2: 20).stroke(fill: Color.red, width: 3, cap: .round),
Line(x1: 0, y1: 0, x2: 0, y2: 20).stroke(fill: Color.green, width: 3, cap: .round),
Line(x1: 20, y1: 0, x2: 20, y2: 20).stroke(fill: Color.yellow, width: 3, cap: .round)
],
place: Transform.move(dx: 10, dy: 10).scale(sx: 2, sy: 2)
)
let ani = rect.placeVar.animation(angle: 1.99999 * .pi, x: 10, y: 10).cycle().easing(.linear)
let n = [backg, rect].group()
var r = false
n.onTap(f: { _ in
if r { ani.stop() } else { ani.play() }
r = !r
})
let svgView = SVGView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
svgView.node = n
The text was updated successfully, but these errors were encountered: