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

Use fixupSVGString from scratch-svg-renderer #1346

Closed

Conversation

adroitwhiz
Copy link
Contributor

@adroitwhiz adroitwhiz commented Jan 7, 2021

Depends on scratchfoundation/scratch-svg-renderer#209, scratchfoundation/scratch-svg-renderer#210, and scratchfoundation/scratch-gui#6556

Resolves

Resolves #1269

Proposed Changes

This PR changes the importSVG function to use the fixupSvgString function from scratch-svg-renderer instead of applying its own fixes to the imported SVG string.

Reason for Changes

See the rationale in #210. This should result in all renderable SVGs also being editable in the paint editor--no more SVGs that render but crash the paint editor. Now, either an SVG is parseable or it'll be replaced with the grey question mark asset everywhere.

Test Coverage

Tested manually

@benjiwheeler
Copy link
Contributor

Update: we're doing a similar thing now, with a new sanitization function that is exported from scratch-svg-renderer and which is run on image upload. There are still some differences between rendering in the stage/tiles and in the paint editor, however -- I'm not sure where the problem is with those.

@adroitwhiz adroitwhiz closed this Aug 29, 2022
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.

SVG fixes should be moved to svg-renderer's fix-up-svg
2 participants