Skip to content

Rectangles with rounded corners not supported. #13

@curiousdustin

Description

@curiousdustin

Describe the bug
SVG rectangles with the rx attribute are converted to rectangles without rounded corners.

To Reproduce

<svg width="22" height="4" viewBox="0 0 22 4" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="22" height="4" rx="2" fill="black"/>
</svg>
struct IconMinusShape: Shape {
    func path(in rect: CGRect) -> Path {
        var path = Path()
        let width = rect.size.width
        let height = rect.size.height
        path.addRect(CGRect(x: 0, y: 0, width: width, height: height))
        return path
    }
}

Expected behavior
In this case, the rect should be added to the Swift Shape using path.addRoundedRect but path.addRect is used instead, resulting in a normal rectangle.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions