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

transform baking not working #98

Open
OleksandrKucherenko opened this issue Apr 10, 2018 · 4 comments
Open

transform baking not working #98

OleksandrKucherenko opened this issue Apr 10, 2018 · 4 comments

Comments

@OleksandrKucherenko
Copy link

Before:
        <path fill="#fff" id="a" d="M1007.195 733.064l-73.56-56.43-73.542 56.457 28.313-90.994-73.795-56.092 91.06.193 27.934-91.123 27.964 91.113 91.06-.226-73.777 56.119 28.343 90.983z"/>
        <use xlink:href="#a" transform="translate(577.189)"/>
        <use xlink:href="#a" transform="translate(288.889 -214.211)"/>
        <use xlink:href="#a" transform="translate(108 342.749)"/>
        <use xlink:href="#a" transform="translate(469.189 342.749)"/>

Produced:

    <path
        android:fillColor="#fff"
        android:pathData="M1007.2,733.064 L933.635,676.634 L860.093,733.091 L888.406,642.097 L814.611,586.005 L905.671,586.198 L933.605,495.075 L961.569,586.188 L1052.63,585.962 L978.853,642.081 L1007.2,733.064 Z" />
    <path
        android:fillColor="#fff"
        android:pathData="M1007.2,733.064 L933.635,676.634 L860.093,733.091 L888.406,642.097 L814.611,586.005 L905.671,586.198 L933.605,495.075 L961.569,586.188 L1052.63,585.962 L978.853,642.081 L1007.2,733.064 Z" />
    <path
        android:fillColor="#fff"
        android:pathData="M1007.2,733.064 L933.635,676.634 L860.093,733.091 L888.406,642.097 L814.611,586.005 L905.671,586.198 L933.605,495.075 L961.569,586.188 L1052.63,585.962 L978.853,642.081 L1007.2,733.064 Z" />
    <path
        android:fillColor="#fff"
        android:pathData="M1007.2,733.064 L933.635,676.634 L860.093,733.091 L888.406,642.097 L814.611,586.005 L905.671,586.198 L933.605,495.075 L961.569,586.188 L1052.63,585.962 L978.853,642.081 L1007.2,733.064 Z" />
    <path
        android:fillColor="#fff"
        android:pathData="M1007.2,733.064 L933.635,676.634 L860.093,733.091 L888.406,642.097 L814.611,586.005 L905.671,586.198 L933.605,495.075 L961.569,586.188 L1052.63,585.962 L978.853,642.081 L1007.2,733.064 Z" />

Correct After:

        <path d="M1007.2,733.06l-73.56-56.43-73.54,56.46,28.31-91L814.61,586l91.06.19,27.93-91.12,28,91.11,91.06-.23-73.78,56.12Z" fill="#fff"/>
        <path d="M1584.38,733.06l-73.56-56.43-73.54,56.46,28.31-91L1391.8,586l91.06.19,27.93-91.12,28,91.11,91.06-.23L1556,642.08Z" fill="#fff"/>
        <path d="M1296.08,518.85l-73.56-56.43L1149,518.88l28.31-91-73.79-56.09,91.06.19,27.93-91.12,28,91.11,91.06-.23-73.78,56.12Z" fill="#fff"/>
        <path d="M1115.19,1075.81l-73.56-56.43-73.54,56.46,28.31-91-73.79-56.09,91.06.19,27.93-91.12,28,91.11,91.06-.23-73.78,56.12Z" fill="#fff"/>
        <path d="M1476.38,1075.81l-73.56-56.43-73.54,56.46,28.31-91-73.79-56.09,91.06.19,27.93-91.12,28,91.11,91.06-.23L1448,984.83Z" fill="#fff"/>

what is wrong:

  • all pathData have absolutely the same doubles, transform/translate not applied on them
@OleksandrKucherenko
Copy link
Author

OleksandrKucherenko commented Apr 10, 2018

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform

translate(x [y])
This transform definition specifies a translation by x and y.
This is equivalent to matrix(1 0 0 1 x y). If y is not provided, it is assumed to be zero.

@OleksandrKucherenko
Copy link
Author

https://www.w3.org/TR/SVG/coords.html#__svg__SVGTransformList__consolidate

method that can convert all transformation into matrix

@OleksandrKucherenko
Copy link
Author

@OleksandrKucherenko
Copy link
Author

Another solution:
http://petercollingridge.appspot.com/svg-transforms

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

1 participant