scour icon indicating copy to clipboard operation
scour copied to clipboard

Enable option to clean the `translate`?

Open hanfeisun opened this issue 8 years ago • 2 comments

I have an SVG file with a lot of transform="translate..." attributes

    <path d="M2662.28,2240.07c0-.19,0-0.37,0-0.56a33.91,33.91,0,0,1,.83-5.58l-6.23-4.53a41,41,0,0,0-1.48,8.45Z" transform="translate(-2650 -2215)"/>
    <path d="M2657.26,2228.41l6.2,4.5a6.61,6.61,0,0,1,4.45-4.45l-4.5-6.2A10,10,0,0,0,2657.26,2228.41Z" transform="translate(-2650 -2215)"/>
    <path d="M2668.92,2228.15a55.17,55.17,0,0,1,6.89-.83l0.56,0-2.22-6.84a57,57,0,0,0-9.76,1.48Z" transform="translate(-2650 -2215)"/>

I was wondering whether there will be an option to convert/remove this transform attribute..

hanfeisun avatar Feb 24 '16 11:02 hanfeisun

It should be possible to do this, I encountered this a couple of times myself. The translate values can be added to absolute coordinates (signified by a capital letter in the d string of <path>). The problem is that the path syntax has some caveats.

Just for reference: http://www.w3.org/TR/SVG/paths.html#PathData

Eitot avatar Mar 20 '16 14:03 Eitot

There would be another optimizing issue. If there are several elements with the same translation (or start coords) you can group them. This is not a rare case. The optimizing value is linear to the elements amount (so probably only practicable at more than 3 elements). PS: also often at text elements.

Perhelion avatar Mar 21 '16 08:03 Perhelion