Skip to content
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

LG-4254: Fix SVG scaling in Internet Explorer #5076

Merged
merged 3 commits into from
May 20, 2021
Merged

Conversation

aduth
Copy link
Member

@aduth aduth commented May 19, 2021

Why: So that images don't appear distorted.

Regression of #4635, due to default behavior of SVG optimizer to remove viewBox attribute affecting scaling in Internet Explorer.

Before After
Screen Shot 2021-05-19 at 3 41 48 PM Screen Shot 2021-05-19 at 3 40 53 PM

Related:

Implementation notes:

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

next if %w[vendor node_modules].include?(relative_path.split('/')[1])

files = Dir.glob('{app,public}/**/*.svg', base: Rails.root)
files.reject! { |f| f.start_with? 'public/assets/' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come we're rejecting files in this directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm mistaken, they're just compiled copies (duplicates) of app/assets files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm mistaken, they're just compiled copies (duplicates) of app/assets files.

And: Their presence was causing failures for me locally, likely due to stale assets from an older precompile.

@aduth aduth force-pushed the aduth-lg-4254-svg-scale branch from 5f6999d to 5a07614 Compare May 19, 2021 20:53
@aduth aduth merged commit ad64441 into main May 20, 2021
@aduth aduth deleted the aduth-lg-4254-svg-scale branch May 20, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants