Skip to content

Unexpected animation when changing Shape's fill color #692

@devpolant

Description

@devpolant

Precondition

  • I have the following code to change node's fill color by tap on it:
guard let node = svgView.node.nodeBy(tag: nodeId) as? Shape else {
    return
}
node.onTap { [weak self] _ in
    guard let self = self, let node = self.svgView.node.nodeBy(tag: nodeId) as? Shape else {
        return
    }
    let color = node.fill != self.selectedColor ? self.selectedColor : self.normalColor
    node.fillVar.animate(to: color, during: 0.3)
}

Problem

  • Node is scaling and translating as you could see at the following video:

Demo project

  • Please download this demo project with reproduced issue:
    SVGDemo.zip
  • Do you have any idea how to resolve this issue? Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions