exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.02k stars 556 forks source link

SVG get wrong Z-Index during animation #619

Open agotfredsen82 opened 5 years ago

agotfredsen82 commented 5 years ago

Hi I have a Circle/Shape and a SVGNode

logoImage = try! SVGParser.parse(path: imageName)

let form3 = Circle(cx: radius, cy: radius, r: radius-3) border = Shape(form:form3, stroke:Stroke(fill:mainColor, width: 5, cap: .round))

let logoGroup = [border, logoImage].group()

and then I animate the border with placeVar

border.placeVar.animate(to:Transform.scale(sx:0.5,sy:0.5).move(dx:width/2,dy:width/2))

so far so good but then some strange things happens ..

during placeVar animation the logoImage moves behind the Circle Shape and when the animation ends the logoImage moves infront of the animated circle ... WHY ??? it looks like a bug ..

amarunko commented 5 years ago

@agotfredsen82, yea, really, looks like a bug, we will try to investigate the problem, you can also send a corresponding PR, thank you for providing info

ystrot commented 5 years ago

Hi @agotfredsen82,

It's really an issue. The workaround you may use for now is content animation: https://github.com/exyte/Macaw/wiki/Content-animation