Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectangles with rounded corners not supported. #13

Open
curiousdustin opened this issue May 19, 2022 · 0 comments
Open

Rectangles with rounded corners not supported. #13

curiousdustin opened this issue May 19, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@curiousdustin
Copy link

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.

@bring-shrubbery bring-shrubbery self-assigned this Jun 3, 2022
@bring-shrubbery bring-shrubbery added the enhancement New feature or request label Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants