Skip to content

Conversation

@adroitwhiz
Copy link
Contributor

Resolves

A step towards #540

Proposed Changes

This PR implements the "refactoring" half of the "gradient outlines" changes--this should contain no functional changes but cleans up the codebase in preparation for adding gradient outline support.

Reason for Changes

See above

Test Coverage

Tests have been updated accordingly

A "style" refers to something that can fill/stroke a shape.
Currently that's either a solid color or a gradient of some orientation.
The selection gradient type reducer has been removed and folded into the
"fill style" reducer.
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.

Thanks for splitting all this out, it helps a lot!

I ran into an issue where if you select a shape with a hole, and set the fill to a gradient, then the fill becomes transparent:
Screen Shot 2020-07-13 at 15 55 33

@fsih
Copy link
Contributor

fsih commented Jul 13, 2020

Here's the same SVG exported from scratch.mit.edu vs exported from the gradient-outlines branch: https://www.diffchecker.com/xGHcgGmX

@fsih fsih assigned adroitwhiz and unassigned fsih Jul 14, 2020
fsih
fsih previously approved these changes Jul 20, 2020
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.

LGTM!

colorState.secondary = MIXED;
}

return colorState;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we document the params of the return value, and note that gradientType may be null?

@adroitwhiz
Copy link
Contributor Author

I've changed applyGradientTypeToSelection to call createGradientObject when creating gradients-- this is important in part 2 when we change createGradientObject to enforce a minimum distance between the gradient start and end points (this fixes perfectly vertical gradients on perfectly horizontal lines, or vice versa, from disappearing).

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!

@adroitwhiz adroitwhiz merged commit 0f5fb40 into scratchfoundation:develop Jul 28, 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.

2 participants