Skip to content

Conversation

@liyuqian
Copy link
Contributor

@liyuqian liyuqian commented Aug 13, 2018

This allows developers to control the clipBehavior of those buttons.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@Hixie
Copy link
Contributor

Hixie commented Aug 13, 2018

Can't the ink well do its own clipping? We don't want to be clipping when there's no splash, right?

@liyuqian
Copy link
Contributor Author

@Hixie yes, now I used the InkWell's own borderRadius to do the clip. It seems that @lukef added the borderRadius clip about a year ago but half a year later @HansMuller made buttons to use Material's clip instead (so the borderRadius clip was never called after then)... We didn't find clip issues in the rounded rect button after setting Material's clip to none because the default rrect radii are very small and the splash/highlight color is close to transparent. If we have a magnifier, we would see the bleeding highlights and splash there too. This change should fix them all.

@HansMuller
Copy link
Contributor

I don't think this is the right fix. RawMaterialButton splashes should still be unconditionally clipped to their shape (to the shape of their Material). The default clip should not be Clip.none.

@jonahwilliams
Copy link
Contributor

Rather than try and forward fix this, lets roll back the original clipping PR (so I can roll g3) and spend the time on the right fix

@liyuqian
Copy link
Contributor Author

liyuqian commented Aug 14, 2018 via email

@liyuqian
Copy link
Contributor Author

@jonahwilliams Since a full revert might have many conflicts, I'll merge this once all tests are passed. (Feel free to merge it if I forgot.) This should unblock the roll. I'll discuss with Hans and Ian later (unfortunately not today due to WFH) to see what's the right fix.

@jonahwilliams
Copy link
Contributor

Let's hold off on this one until we land the revert and have time to fully understand the clipping implications.

@Hixie
Copy link
Contributor

Hixie commented Aug 14, 2018

Yeah the clip should be to the shape of the material, but it shouldn't be done by material, it should be done by the ink itself. We'll have to pass the shape to the inkwell.

@Hixie
Copy link
Contributor

Hixie commented Aug 14, 2018

...and indeed it might be cheaper for the splash to use the path ops to find the intersection of the splash and the shape than to actually clip anything.

@liyuqian liyuqian changed the title Expose clipBehavior to FloatingActionButton Expose clipBehavior to more Material Buttons Aug 24, 2018
@liyuqian
Copy link
Contributor Author

@jonahwilliams @Hixie would you please review this simple PR again that exposes clipBehavior to more material buttons? Now we don't have to worry about InkWell as our other PRs have handled it.

@HansMuller
Copy link
Contributor

What about MaterialButton, RaisedButton, and OutlineButton? I think it would be a good idea to take care of all of these at once

@liyuqian
Copy link
Contributor Author

@HansMuller the clipBehavior is already defined in those buttons.

@Hixie
Copy link
Contributor

Hixie commented Aug 24, 2018

LGTM. We should probably add some tests that verify that we're not adding clips back.

@liyuqian liyuqian merged commit 5d6707b into flutter:master Aug 24, 2018
@liyuqian liyuqian deleted the actionbutton branch August 27, 2018 23:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 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.

5 participants