-
Notifications
You must be signed in to change notification settings - Fork 364
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
Get ImageMap Shape tessilation right #163
Get ImageMap Shape tessilation right #163
Conversation
Seems to work correctly in Acrobat Reader.
Just got the information from the author of the kong algorithm implementation that the source is licensed using MIT and that we can freely use it. We can mention him in the release notes, but we don't have to. I'll add the changes for that and also will fix the transform / scaling stuff. So you may wait a day or two until you merge this branch, as I will future work on it. |
…This allows to use the full transform matrix to be applied on the resulting map for the link. But the rectangle box of the link does not yet consider the transform correctly.
inside the target area. Hmm, seems to be a display bug in Acrobat...
Shape<->Link Map. Also fixes some corner cases when splitting triangles for the links. Do not add annotations with empty quad links. Added an example of how to use objects drawers to draw Pie and Bar charts using JFreeChart. This tries to also provide the Shape<->Link map for each item. But does not work at the moment... for whatever reason.
…mple. Now the links work as intended.
@danfickle I'm done with my changes here. Currently the transforms applied through CSS "transform" are not applied on the transform which is given to the link manager. Because of this transformed objects have their links wrong: Other than that it seems ok now. This PullRequest should now be ready for merge. Some other thing: To test this out I've integrated JFreeChart into the examples and build some small example object drawer which allow to define graphs using objects in HTML. Should we provide such object drawers in e.g. a openhtmltopdf-objects library? Then openhtmltopdf could draw different kinds of diagrams "out of the box". What do you think? |
Thanks @rototor - I have no problem with extra modules to incorporate different object drawers. It seems like a pretty good idea. The only caution I have is documenting all the new feature we’re (well, mostly you - thank you) adding. |
Using https://www.sunshine2k.de/coding/java/Polygon/Kong/Kong.html
I've adapted the class for this use case. In the readme provided with the java sources the author says "please give me some credits". IANAL but I think it should be save to include the files here. But I will check back with the author.
From the given transform only the scale is used, as I could not get the concatination of the transform working correctly. This should only affect images affected by CSS-transform. Feel free to fix this, to make this work correctly with CSS-transforms.
In the sample svg-inline there is now a image map using two rectangles and a circle. Those work with Acrobat Reader with this changes. Mac OS X preview seems to ignore the quad points.