revery-ui / revery

:zap: Native, high-performance, cross-platform desktop apps - built with Reason!
https://www.outrunlabs.com/revery/
MIT License
8.06k stars 196 forks source link

fix(box-shadow): Toggling box-shadow style had no effect #999

Closed bryphe closed 3 years ago

bryphe commented 3 years ago

Issue: If a boxShadow(...) style was set on a node, and then turned off later, the box-shadow would continue to be shown.

Defect: When boxShadow(..) is set - we add an image filter onto the Skia.Paint.t owned by the node. This is stateful - if we don't do anything, the box shadow image filter will continue to be applied.

Fix: Turn off the image filter when we don't need it anymore.

This also moves the box-shadow rendering to occur before the border and interior elements are painted. Without this, the box-shadow would be rendered along with the interior element, which would actually draw part of the shadow over the border. I think a better flow would be to draw the interior element first w/ a shadow, and then the borders - but right now, we use the borders to calculate the interior element positioning.

github-actions[bot] commented 3 years ago

I have updated your lock dirs and formatted the code. Please @bryphe pull the last commit before pushing any more changes.