CSS-like shadows with offset, spread, and blur #4232
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.
This makes
epaint::Shadow
more like CSS's box-shadow, addingoffset
and replacingextrusion
withblur
andspread
.The offsets make for nice drop-shadow effects.
Old shadows:
![old-shadows](https://private-user-images.githubusercontent.com/1148717/316801383-8a30f7b9-fb9d-49ea-9a2f-9367a60c448a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4ODkwMTYsIm5iZiI6MTcyNTg4ODcxNiwicGF0aCI6Ii8xMTQ4NzE3LzMxNjgwMTM4My04YTMwZjdiOS1mYjlkLTQ5ZWEtOWEyZi05MzY3YTYwYzQ0OGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDlUMTMzMTU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjM1YjY0OWZhYmRlNWZhYzUyZTgyY2M1OTQyZTUyNTE5ODlhZTA2YTNjZDE3ZDdjNTI0ZDYzNDU0YmZmMjIxMCZ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