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

Set stroke-linejoin and stroke-linecap to "round" for gradient strokes in 2.0 SVGs #87

Merged
merged 1 commit into from Feb 4, 2020

Conversation

adroitwhiz
Copy link
Contributor

@adroitwhiz adroitwhiz commented Apr 26, 2019

Resolves

Resolves the rest of scratchfoundation/scratch-render#194
Resolves scratchfoundation/scratch-paint#394

Proposed Changes

This PR adds another function to SvgRenderer which rounds all strokes with a gradient color. This function is only called for 2.0 ("version 2") SVGs. It also changes SvgRenderer._collectElements to allow the caller to optionally collect all elements, which I used in the stroke-rounding function.

Reason for Changes

In Scratch 2.0, for some inexplicable reason, all strokes with a gradient color have rounded joins and caps:
Peek 2019-04-26 16-49

This is relied upon in things like the text bubble from project #186282308:

Current This PR Scratch 2.0
image image image

@adroitwhiz adroitwhiz changed the title Set stroke-linejoin and stroke-linecap to gradient strokes round Set stroke-linejoin and stroke-linecap to "round" for gradient strokes in 2.0 SVGs Apr 26, 2019
@thisandagain thisandagain added this to the May 2019 milestone Apr 29, 2019
src/svg-renderer.js Outdated Show resolved Hide resolved
src/svg-renderer.js Outdated Show resolved Hide resolved
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 67a513c into scratchfoundation:develop Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vector costumes with rounded corners aren't imported correctly
4 participants