GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
It seemed to me that images (when created via 'fromElement') where not placed correctly. Also the given sizes where ignored. Therefore I adjusted the corresponding parts.
Adjust positioning / scaling of image objects created via `fromElement`.
Do you have a test case showing images positioned wrong?
improved image position and scaling to comply with http://www.w3.org/…
have a look at this side by side comparison:
current implementation: http://jsfiddle.net/gr6mr/1/
adjusted implementation: http://jsfiddle.net/gr6mr/2/
the adjustments apply to http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute (without support for slice)
How come the options are dropped here?
options may contain with or height values wich will override the values from the image tag. This is unwanted because the image width and and height are needed for positioning and stretching.
@franatique Looks good, thanks! I'll check if all existing tests still pass and merge this in. Would be good to also move your comparison test into our suite.
One more thing: shouldn't we also use "preserveAspectRatio" in fabric.Image#toSVG?
you're right. I'll take care of it.
Need to integrate this with newly added originX/originY properties, and with new master.