{"action":"created","issue":{"url":"https://api.github.com/repos/SVGKit/SVGKit/issues/522","repository_url":"https://api.github.com/repos/SVGKit/SVGKit","labels_url":"https://api.github.com/repos/SVGKit/SVGKit/issues/522/labels{/name}","comments_url":"https://api.github.com/repos/SVGKit/SVGKit/issues/522/comments","events_url":"https://api.github.com/repos/SVGKit/SVGKit/issues/522/events","html_url":"https://github.com/SVGKit/SVGKit/issues/522","id":219741030,"node_id":"MDU6SXNzdWUyMTk3NDEwMzA=","number":522,"title":"SVG not maintaining aspect ration","user":{"login":"jhndnnqsc","id":17261553,"node_id":"MDQ6VXNlcjE3MjYxNTUz","avatar_url":"https://avatars1.githubusercontent.com/u/17261553?v=4","gravatar_id":"","url":"https://api.github.com/users/jhndnnqsc","html_url":"https://github.com/jhndnnqsc","followers_url":"https://api.github.com/users/jhndnnqsc/followers","following_url":"https://api.github.com/users/jhndnnqsc/following{/other_user}","gists_url":"https://api.github.com/users/jhndnnqsc/gists{/gist_id}","starred_url":"https://api.github.com/users/jhndnnqsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhndnnqsc/subscriptions","organizations_url":"https://api.github.com/users/jhndnnqsc/orgs","repos_url":"https://api.github.com/users/jhndnnqsc/repos","events_url":"https://api.github.com/users/jhndnnqsc/events{/privacy}","received_events_url":"https://api.github.com/users/jhndnnqsc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-04-05T23:07:13Z","updated_at":"2018-11-20T14:35:46Z","closed_at":null,"author_association":"NONE","body":"Using this SVG ( https://upload.wikimedia.org/wikipedia/commons/c/c0/RATED_PG-13.svg ) I am having issues maintaining aspect ratio when using SVGKFastImageView. I have tried setting contentMode = UIViewContentModeScaleAspectFit and scaleToFitInside: and neither ( or both ) have any affect. In the debugger, svgView._internalSizeThatWasSetExplicitlyByUser does have the correct aspect ratio. Is there anything else I need to do so my image is drawn correctly?"},"comment":{"url":"https://api.github.com/repos/SVGKit/SVGKit/issues/comments/440294509","html_url":"https://github.com/SVGKit/SVGKit/issues/522#issuecomment-440294509","issue_url":"https://api.github.com/repos/SVGKit/SVGKit/issues/522","id":440294509,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDI5NDUwOQ==","user":{"login":"adamgit","id":292345,"node_id":"MDQ6VXNlcjI5MjM0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/292345?v=4","gravatar_id":"","url":"https://api.github.com/users/adamgit","html_url":"https://github.com/adamgit","followers_url":"https://api.github.com/users/adamgit/followers","following_url":"https://api.github.com/users/adamgit/following{/other_user}","gists_url":"https://api.github.com/users/adamgit/gists{/gist_id}","starred_url":"https://api.github.com/users/adamgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamgit/subscriptions","organizations_url":"https://api.github.com/users/adamgit/orgs","repos_url":"https://api.github.com/users/adamgit/repos","events_url":"https://api.github.com/users/adamgit/events{/privacy}","received_events_url":"https://api.github.com/users/adamgit/received_events","type":"User","site_admin":false},"created_at":"2018-11-20T14:35:46Z","updated_at":"2018-11-20T14:35:46Z","author_association":"CONTRIBUTOR","body":"When this was written (has anything changed? Has UIView gained new options \nto support all missing cases?) Apple's UIView does not support as many \nsizing options as SVG requires (including: SVGs can specify their own \nsizing! Apple doesn't let images do that). Therefore I don't see how you \ncould support the UIView method unless you disable core features of SVG?\n\nThat's an option: we could offer a flag that breaks your SVG rendering \n(some files would be unaffected, others would be affected negatively,  and \nit would be your responsibility to make sure you only ever draw files that \nare unaffected) so that you can use the small subset of sizes Apple \nrecognizes. But it would have to default to disabled I think (it breaks the \nSVG spec, by disabling SVGs own builtin scaling behaviour).\n\n\nTL;DR: there is no perfect solution here, because Apple does not allow \npeople to extend their API, and their API does not have enough options to \ncover all rendering situations. They designed it for doing simple bitmap \nonly, eg PNG.\n\nOn 20 November 2018 2:14:11 pm Drew Covi <notifications@github.com> wrote:\n\n> @adamgit as per the docs, it appears that SVGKFastImageView is a version of \n> UIImageView which the article references.\n>\n> http://cocoadocs.org/docsets/SVGKit/1.2.0/Classes/SVGKFastImageView.html\n>\n> As per that article\n>\n> ```\n> The default if you do not set a content mode is .scaleToFill shown below left.\n> .scaleToFill stretches the view to fill the available space without\n> maintaining the aspect ratio.\n> ```\n>\n> This reflects the behavior I'm seeing with SVGKFastImageView as implemented \n> in nativescript-svg. By default it appears to discard preserveAspectRatio \n> attributes and defaults to stretching to fill.\n>\n> --\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub:\n> https://github.com/SVGKit/SVGKit/issues/522#issuecomment-440287288\n\n\n\n"}}
{"actor":{"display_login":"adamgit"}}