-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
box-shadow clipping fix #16790
box-shadow clipping fix #16790
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw possibly related to this PR, this line looks odd to me:
let positions = QUAD_VERTEX_POSITIONS
.map(|pos| (box_shadow.transform * (pos * rect_size).extend(1.)).xyz());
Shouldn't it be transform + (pos * rect_size)
?
|
Objective
Instead of clipping the non-visable sections of box-shadows, the shadow is scaled to fit into the remaining area after clipping because the normalized coordinates that are meant to border the unclipped subsection of the shadow are always set to
[Vec2::ZERO, Vec2::X, Vec2::ONE, Vec2::Y]
,Solution
Calculate the coordinates for the corners of the visible area.
Testing
Test app:
Main:
This PR: