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

viewbox minx/miny is other than 0 (not supported) #60

Open
StanKocken opened this issue Jul 28, 2016 · 0 comments
Open

viewbox minx/miny is other than 0 (not supported) #60

StanKocken opened this issue Jul 28, 2016 · 0 comments

Comments

@StanKocken
Copy link

StanKocken commented Jul 28, 2016

I have this issue with: viewbox minx/miny is other than 0 (not supported).
I understand the issue, the fix I'm doing on my side is to play with translateX, translateY. Can this be integrate into the tool?

Imagine I have a SVG:

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="10 -10 30 30" enable-background="new 10 -10 30 30" xml:space="preserve">
<g>
     <rect width="26" height="26" x="12" y="-8" fill="#FF0000" />
</g>
</svg>

The convert will produce:

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="30dp"
    android:height="30dp"
    android:viewportWidth="30"
    android:viewportHeight="30">
    <path
        android:fillColor="#FF0000"
        android:pathData="M 12 -8 H 38 V 18 H 12 V -8 Z" />
</vector>

Why not wrap it with a group translate:

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="30dp"
    android:height="30dp"
    android:viewportWidth="30"
    android:viewportHeight="30">
    <group
        android:translateX="-10"
        android:translateY="10">
        <path
            android:fillColor="#FF0000"
            android:pathData="M 12 -8 H 38 V 18 H 12 V -8 Z" />
    </group>
</vector>

Thanks

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

No branches or pull requests

2 participants