dompdf/php-svg-lib

Incorrect handling of "rotate" transformation with origin coordinates

hakimio opened this issue · 7 comments

Axis title text is positioned incorrectly when rendering following image:

dual axis.txt

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.

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

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...

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

@Naitsirch There is only one person maintaining dompdf nowadays.

Okay, I see :-/

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