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

Clean up SVG renderer code #212

Merged
merged 3 commits into from
Feb 19, 2021

Conversation

adroitwhiz
Copy link
Contributor

@adroitwhiz adroitwhiz commented Jan 7, 2021

Resolves

A step towards #211 and scratchfoundation/scratch-render#594

Proposed Changes

This includes the first 3 commits from #127, with the requested changes made:

  • Remove deprecated, now-unused functions from SvgRenderer, and update the documentation and playground to match.
  • Document SvgRenderer's properties.
  • Clean up the scaling code in SvgRenderer._drawFromImage.

Reason for Changes

These changes make it easier to split SvgRenderer up into multiple parts, some of which can be moved into the specific repositories which need them, and allow more complex changes like the ones required by scratchfoundation/scratch-render#594 to be implemented without touching this repo.

Test Coverage

All existing tests pass

@adroitwhiz adroitwhiz changed the title Subpixel v3 cleanups Clean up SVG renderer code Jan 7, 2021
this._context.setTransform(1, 0, 0, 1, 0, 0);
// Set the CSS style of the canvas to the actual measurements.
this._canvas.style.width = bbox.width;
this._canvas.style.height = bbox.height;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copying this comment over from the other PR: this was added way back in scratchfoundation/scratch-render@b35f684 and we were unable to determine why, exactly.

We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea what changed here--doesn't seem to be missing a newline

Copy link
Contributor

@fsih fsih left a comment

Choose a reason for hiding this comment

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

LG, thanks!

@fsih fsih merged commit 8941fb1 into scratchfoundation:develop Feb 19, 2021
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