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

Long path #55

Open
WildOrangutan opened this issue Oct 29, 2024 · 1 comment
Open

Long path #55

WildOrangutan opened this issue Oct 29, 2024 · 1 comment

Comments

@WildOrangutan
Copy link

Vector paths are joined into 1. This produces a long path, which is bad for performance of the vector. Is this intentional behavior?

Following vector

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="240dp"
    android:height="240dp"
    android:viewportWidth="240"
    android:viewportHeight="240">
    <path
        android:fillColor="#FF000000"
        android:pathData="M168 72H72v96h96V72Z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M134 88.05l1.48 11.25 1.48-11.25h7.93 0.02v24.86h-5.99v-11.24l-1.37 11.24h-4.02l-1.48-11.24v11.24h-5.98V88.05H134Z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M119.3 87.84h-2.84c-3.59 0-5.32 1.74-5.32 5.32v14.63c0 3.6 1.73 5.33 5.32 5.33h2.85c3.58 0 5.32-1.74 5.32-5.33V93.16c0-3.58-1.74-5.32-5.32-5.32Zm-0.72 19.6c0 0.37-0.3 0.67-0.68 0.67-0.4 0-0.72-0.3-0.72-0.68V93.5c0-0.39 0.31-0.68 0.68-0.68 0.42 0 0.73 0.3 0.73 0.68v13.93Z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M104.17 88h-2.85C97.73 88 96 89.74 96 93.32v14.63c0 3.6 1.73 5.33 5.32 5.33h2.85c3.58 0 5.32-1.74 5.32-5.33V93.32c0-3.58-1.74-5.32-5.32-5.32Zm-0.72 19.6c0 0.37-0.3 0.67-0.69 0.67-0.4 0-0.72-0.3-0.72-0.68V93.66c0-0.4 0.31-0.68 0.68-0.68 0.42 0 0.73 0.29 0.73 0.68v13.93Z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M104.03 117.16h-2.84c-3.6 0-5.33 1.74-5.33 5.32v14.63c0 3.59 1.73 5.33 5.33 5.33h2.84c3.58 0 5.32-1.74 5.32-5.33v-14.63c0-3.58-1.74-5.32-5.32-5.32Zm-0.72 19.59c0 0.37-0.3 0.67-0.69 0.67-0.4 0-0.71-0.3-0.71-0.67V122.8c0-0.38 0.3-0.67 0.67-0.67 0.42 0 0.73 0.29 0.73 0.67v13.94Z"/>
</vector>

Is converted to:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="240dp"
    android:height="240dp"
    android:viewportWidth="240"
    android:viewportHeight="240">
    <path
        android:fillColor="#FF000000"
        android:pathData="M168 72H72v96h96V72z" />
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M134 88.05l1.48 11.25 1.48-11.25h7.95v24.86h-5.99v-11.24l-1.37 11.24h-4.02l-1.48-11.24v11.24h-5.98V88.05H134zm-14.7-0.21h-2.84c-3.59 0-5.32 1.74-5.32 5.32v14.63c0 3.6 1.73 5.33 5.32 5.33h2.85c3.58 0 5.32-1.74 5.32-5.33V93.16c0-3.58-1.74-5.32-5.32-5.32zm-0.72 19.6c0 0.37-0.3 0.67-0.68 0.67-0.4 0-0.72-0.3-0.72-0.68V93.5c0-0.39 0.31-0.68 0.68-0.68 0.42 0 0.73 0.3 0.73 0.68v13.93zM104.17 88h-2.85C97.73 88 96 89.74 96 93.32v14.63c0 3.6 1.73 5.33 5.32 5.33h2.85c3.58 0 5.32-1.74 5.32-5.33V93.32c0-3.58-1.74-5.32-5.32-5.32zm-0.72 19.6c0 0.37-0.3 0.67-0.69 0.67-0.4 0-0.72-0.3-0.72-0.68V93.66c0-0.4 0.31-0.68 0.68-0.68 0.42 0 0.73 0.29 0.73 0.68v13.93zm0.58 9.56h-2.84c-3.6 0-5.33 1.74-5.33 5.32v14.63c0 3.59 1.73 5.33 5.33 5.33h2.84c3.58 0 5.32-1.74 5.32-5.33v-14.63c0-3.58-1.74-5.32-5.32-5.32zm-0.72 19.59c0 0.37-0.3 0.67-0.69 0.67-0.4 0-0.71-0.3-0.71-0.67V122.8c0-0.38 0.3-0.67 0.67-0.67 0.42 0 0.73 0.29 0.73 0.67v13.94z" />
</vector>
@isink17
Copy link

isink17 commented Jan 11, 2025

It seems to be intentional.
I've had simmilar problem, it also did merge paths but it did crash the app - it seems like paths longer than 3000 characters crash applications.

Because of that, I made a new version of avocado.
If you want to try it, please check av_optimizer

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