-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Parse x y svg attributes #2399
Parse x y svg attributes #2399
Conversation
update to master
|
||
if (parsedAttributes.preserveAspectRatio) { | ||
aspectRatioAttrs = parsedAttributes.preserveAspectRatio.split(' '); | ||
preserveAR = fabric.util.parsePreserveARAttribute(parsedAttributes.preserveAspectRatio); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this code in external function because we need to reuse it also for svg tags and not only for image tags.
@kangax ready to merge. |
* @param {string} attribute to be parsed | ||
* @return {Object} an object containing align and meetOrSlice attribute | ||
*/ | ||
parsePreserveARAttribute: function(attribute) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change AR to AspectRatio. Yes, it's a bit long-ish, but AR just looks way too cryptic IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
changed parsePreserveARAttribute to parsePreserveAspectRatioAttribute |
To be parsed LATER for conflict of files.
Example svg:
rendered by browser
rendered by current kitchensinik
rendered with this patch