Skip to content

Problems with clipping during animation #137

@zapletnev

Description

@zapletnev
        let polygonShape = Shape(
            form: Polygon(points: [50, 0, 100, 50, 50, 100, 0, 50]),
            fill: Color.red
        )
        let polygonShape2 = Shape(
            form: Polygon(points: [50, 0, 100, 50, 50, 100, 0, 50]),
            fill: Color.red,
            place: Transform.move(dx: 100, dy: 0)
        )
        
        let polygonShape3 = Shape(
            form: Polygon(points: [50, 0, 100, 50, 50, 100, 0, 50]),
            fill: Color.red,
            place: Transform.move(dx: 200, dy: 0)
        )
        
        let polygonGroup = [polygonShape, polygonShape2, polygonShape3].group()
        
        let clip = Rect(x: 100.0, y: 0.0, w: 100.0, h: 100.0)
        let clipShape = Shape(form: clip, stroke: Stroke(fill: Color.yellow))
        
        let polygonGroupGroup = [polygonGroup].group()
        
        // COMMENT this line
        polygonGroup.clip = clip
        
        polygonGroup.onTap { _ in
            polygonGroup.placeVar.animation(to: polygonGroup.place.move(dx: -100.0, dy: 0.0)).easing(.linear).cycle().play()
        }
        self.node = [polygonGroupGroup, clipShape].group()
        self.node.place = Transform.move(dx: 50, dy: 300)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions