Skip to content

Add space to the clipping region of physical model layers with shadows #9654

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

Merged
merged 1 commit into from
May 1, 2017

Conversation

jason-simmons
Copy link
Member

No description provided.

@jason-simmons
Copy link
Member Author

@abarth

// picture's bounds, so we draw a hardcoded amount of extra space to
// account for the maximum potential area of the shadow.
canvas.drawRect(offsetBounds.inflate(20.0),
new Paint()..color=const Color(0));
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems pretty hacky (painting invisible black should be a no-op, inflating by 20 pixels seems arbitrary). Is there a long-term fix planned?

At a minimum we should add a TODO to fix this.

Copy link
Member Author

Choose a reason for hiding this comment

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

At some point Skia should provide a way to calculate the area drawn by the shadow and adjust the picture's size accordingly. Until that's available, we need to do some other operation that causes the picture to extend its bounds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, in that case the TODO can just be "Remove this once skia does it for us". :-)

@jason-simmons jason-simmons merged commit 2ab631b into flutter:master May 1, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants