dompdf / php-svg-lib

SVG file parsing / rendering library
GNU Lesser General Public License v3.0
1.41k stars 77 forks source link

Incorrect handling of "rotate" transformation with origin coordinates #15

Closed hakimio closed 6 years ago

hakimio commented 7 years ago

Axis title text is positioned incorrectly when rendering following image:

dual axis.txt

hakimio commented 7 years ago

The actual and the main reason why vertical axis labels are positioned incorrectly is that rotation origin points are ignored (second and third "rotate" transformation parameters). I have made it work in my fork of this project: https://github.com/hakimio/php-svg-lib https://github.com/hakimio/dompdf

I would make a pull request, but it's been some time since I took trigonometry lessons and I am not sure how to convert rorate() method in CPdf class to do rotation clockwise instead of counter-clockwise the right way. Currently I just reverse the angle by negating it.

stollr commented 6 years ago

I have created a PR now, that fixes the issue with just touching src/Svg/Tag/AbstractTag.php. It's a pity that this project seem to be unmaintained :-(

@PhenX Please check the PR. It would be nice if you could merge it.

PhenX commented 6 years ago

Hello @naitsirch, thank you for the pull request. I agree the project is not well maintained, in fact I don't have time for it anymore...

stollr commented 6 years ago

Maybe you could find volunteers that could help you out ;-) Maybe the guys from Dompdf?

hakimio commented 6 years ago

@naitsirch There is only one person maintaining dompdf nowadays.

stollr commented 6 years ago

Okay, I see :-/

stollr commented 6 years ago

@PhenX I think after you merged #44 this issue can be closed.