Skip to content

Remove SvgRenderer.fromString call from SVGSkin.setSVG #522

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

Closed

Conversation

adroitwhiz
Copy link
Contributor

@adroitwhiz adroitwhiz commented Nov 1, 2019

Depends on scratchfoundation/scratch-svg-renderer#107

Resolves

Resolves #518

Proposed Changes

This PR removes the call to SVGSkin._svgRenderer.fromString from the SVGSkin.loadSVG method, in the process updating SVGSkin to use the new methods added in scratchfoundation/scratch-svg-renderer#107.

Reason for Changes

Removing the SVGSkin._svgRenderer.fromString call prevents the skin from being unnecessarily drawn twice (see #518 for more details).

Updating SVGSkin to use the new SvgRenderer methods makes the code much easier to reason about by removing unpredictable behavior (see this comment and scratchfoundation/scratch-svg-renderer#107 for more information).

@adroitwhiz adroitwhiz changed the title Remove SvgRenderer._draw call from SVGSkin.setSVG Remove SvgRenderer.fromString call from SVGSkin.setSVG Nov 2, 2019
@adroitwhiz
Copy link
Contributor Author

Closing in favor of #527

@adroitwhiz adroitwhiz closed this Nov 26, 2019
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.

The call to svg-renderer._draw in SVGSkin.setSVG isn't necessary
1 participant