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

--optimize=simplify-transform gives wrong result #131

agrahn opened this issue Mar 20, 2020 · 3 comments

--optimize=simplify-transform gives wrong result #131

agrahn opened this issue Mar 20, 2020 · 3 comments


Copy link

@agrahn agrahn commented Mar 20, 2020

Consider the example code testfile.tex:



some text\special{dvisvgm:raw <path d='M{?x} {?y} l40 -50' stroke='blue' />}%
\special{dvisvgm:raw <g transform='scale(-1)translate(-40,50)scale(-1)'>}%
\special{dvisvgm:raw </g>}


After processing with

dvisvgm --bbox=papersize --font-format=woff --zoom=-1 --optimize=simplify-transform testfile

the transform attribute in the second special is written as transform='translate(40 50)' into the SVG file, but it should be transform='translate(40 -50)'.

Compare with the non-optimized SVG obtained with

dvisvgm --bbox=papersize --font-format=woff --zoom=-1 testfile 

I am using dvisvgm-2.9.



This comment has been minimized.

Copy link

@mgieseki mgieseki commented Mar 21, 2020

This is a stupid bug in the parser evaluating the transform commands. The long form scale(-1,-1) translate(-40,50) scale(-1,-1) should work as expected. I'll push the fix shortly.

BTW, nice manual matrix calculations at so late hour. I always manage to introduce mistakes into them.

@mgieseki mgieseki self-assigned this Mar 21, 2020
@mgieseki mgieseki added the bug label Mar 21, 2020
@mgieseki mgieseki closed this in 1cdd816 Mar 21, 2020
@mgieseki mgieseki added this to the 2.9.1 milestone Mar 21, 2020

This comment has been minimized.

Copy link

@agrahn agrahn commented Mar 21, 2020

Thank you, Martin, for swiftly fixing this!

Also, 6005e50, the new calculator macro works like a charm! Do you think we could persuade Karl (@kberry) to still merge the recent changes into TL-20? Otherwise, I am looking forward to TeXLive-21 next year :-).


This comment has been minimized.

Copy link

@kberry kberry commented Mar 21, 2020

ok, in progress. i really really want this to be the last ...

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.