Fix node highlight for all shapes #2430
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2429.
Clouds
Instead of drawing one shape with both fill and stroke for the highlight, the same shape is rendered twice with slightly different radii, no fill and a very thick stroke which ensures uniform highlight thickness around the shape. It's a slightly hacky solution (especially with adjusting the colors & opacities), but it seems to work well. Thanks @foot for the idea!
Stacks
Instead of a stretched highlight shape, a regular highlight is drawn around the bottommost layer of the stack. On top of that, the whole stack is slightly skewed to the left for a more 3D feel - not sure if we want that change though, my initial motivation was to make the highlight look better, but now I think the whole stack looks better when skewed (even when not highlighted).Turns out that using the border trick also made the stack highlight look better. Drawing an extra fake shape just for the highlight is still not ideal, but the alternative would be to use some heavy SVG masks/clipping which might give an even heaver load on rendering (and certainly be harder to implement).