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

Consider using a PathParser #26

Open
bartek-wesolowski opened this issue Apr 15, 2024 · 1 comment
Open

Consider using a PathParser #26

bartek-wesolowski opened this issue Apr 15, 2024 · 1 comment

Comments

@bartek-wesolowski
Copy link

Instead of constructing images like this:

path(fill = SolidColor(Color(0xFFfcf7d2)), stroke = null, strokeLineWidth = 0.0f,
        strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
        pathFillType = NonZero) {
    moveTo(1037.06f, 87.81f)
    horizontalLineToRelative(92.36f)
    lineTo(1129.42f, 22.7f)
    lineTo(1026.06f, 22.7f)
    verticalLineToRelative(54.12f)
    curveToRelative(0.0f, 6.07f, 4.93f, 11.0f, 11.0f, 11.0f)
}

Consider using a PathParser

addPath(
    PathParser().parsePathString(
        "M256 0 c4.6 0 9.2 1 13.4 2.9 l188.3 79.9 c22 9.3 38.4 31 38.3 57.2 -0.5 99.2 -41.3 280.7 -213.6 363.2 -16.7 8 -36.1 8 -52.8 0 C57.3 420.7 16.5 239.2 16 140 c-0.1 -26.2 16.3 -47.9 38.3 -57.2 L242.7 2.9 C246.8 1 251.4 0 256 0z m0 66.8 v378 C394 378 431.1 230.1 432 141.4 L256 66.8z"
    ).toNodes()
)

This would make the result code much shorter and possibly help (partially) solve #16 with MethodTooLargeException.

@Goooler
Copy link

Goooler commented Jul 31, 2024

You can try out https://github.com/ComposeGears/Valkyrie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants