Implement CSS3 transform
rototor opened this issue · 7 comments
I've started implementing CSS3 transform. My primary goal is to get rotate() working. The rest should be relative easy, but I primary need rotate(90deg).
You can view the my current development here https://github.com/rototor/openhtmltopdf/tree/css3-transform-implementation
CSS parsing should be mostly done, but it is not yet applied on the elements. I'll be away for a week on holidays, but will continue to implement this afterwards.
Note, related to #23 I implemented saveSate() and restoreState() - also for Java2D.
@rototor - Looks good. The hard part is implementing transform origin I think (from memory).
@rototor - Would you mind submitting a pull request with what you have got and I'll see if I can help with implementation?
Thanks,
Daniel.
P.S I hope you had a wonderful holiday!
@danfickle I sent you a pull request #45. Sorry for the delay, after holiday the usual "we need that and that now" happened in work... had no time yet to look future into this...
Thanks mate, I'll see how far I get.
OK, initial support has landed.
What is not supported yet:
- Multiple transforms on the one element.
- Transformed element across pages.
translate, translateX, translateY, skew, skewX and skewY
What is supported:
rotate, matrix, scale, scaleX, scaleY
- Transforms on nested elements.
- transform-origin.
- Transforms on the second and subsequent page.
I'll do a release tomorrow so everyone can test it out.
I thought about this some more, the problem with cross-page transforms is that the page(s) to paint text and other content on is determined by the pre-transform coordinates. We need to use the post transform coordinates.
All working now.