-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ASImageNode] Enable .clipsToBounds by default (fix .cornerRadius, GIFs overflow). #466
Conversation
…Fs overflow). We've seen a number of bugs reported over time that .cornerRadius didn't work on ASNetworkImageNode. This wasn't much of a concern because cornerRadius is very inefficient anyway, and there are better ways to round corners, but it should certainly work. It turns out that clipsToBounds has been off for images, and this ultimately was behind another issue recently seen wehre decoded GIFs would spill outside the bounds area to overlap nearby content. Although there is some risk of behavior change from this, I think the risk is fairly small, and in most cases it will probably fix behaviors in a way that doesn't cause problems for the app. We should consider if this property should be on for all ASDisplayNodes, but for now it would be a great step to be confident it's on for all ASImageNodes.
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.
I'm generally fine and as @appleguy said the impact should be reasonable small and the behavior is mostly the one you would like to have. @appleguy just curious is there any performance impact having this property set to YES?
It would differ to the UIKit behavior, if we would enable it for ASDisplayNode
though. The interesting thing is that UILabel also overwrites this property and changes it to yes by default. UILabel has this documented, so would be great if we would explicitly document that at least in the header of ASImageNode
.
Concur with Michael this is a reasonable move, with an assumption that clipsToBounds is pretty fast unless you're masking/rounding corners. But we should document the different default. At first blush I would support generalizing this to ASDisplayNode on that same assumption – having content spill over the bounds should be the exception not the rule. |
I believe it is necessary to use ASNetworkImageNode. You can also pass
file:/// URLs to it. Make sure you have PINRemoteImage linked.
…On Mon, Sep 18, 2017 at 6:24 PM wangqian ***@***.***> wrote:
I want to know how to load a GIF Image using ASImageNode,Thanks.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#466 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAigA2EAuQi566xU2psqUdBneglmfhYjks5sjxflgaJpZM4OgYVr>
.
|
…Fs overflow). (TextureGroup#466) * [ASImageNode] Enable .clipsToBounds by default (fix .cornerRadius, GIFs overflow). We've seen a number of bugs reported over time that .cornerRadius didn't work on ASNetworkImageNode. This wasn't much of a concern because cornerRadius is very inefficient anyway, and there are better ways to round corners, but it should certainly work. It turns out that clipsToBounds has been off for images, and this ultimately was behind another issue recently seen wehre decoded GIFs would spill outside the bounds area to overlap nearby content. Although there is some risk of behavior change from this, I think the risk is fairly small, and in most cases it will probably fix behaviors in a way that doesn't cause problems for the app. We should consider if this property should be on for all ASDisplayNodes, but for now it would be a great step to be confident it's on for all ASImageNodes. * Update changelog for ImageNode Clipping.
We've seen a number of bugs reported over time that .cornerRadius didn't work on
ASNetworkImageNode. This wasn't much of a concern because cornerRadius is very
inefficient anyway, and there are better ways to round corners, but it should
certainly work.
It turns out that clipsToBounds has been off for images, and this ultimately
was behind another issue recently seen where decoded GIFs would spill outside
the bounds area to overlap nearby content.
Although there is some risk of behavior change from this, I think the risk
is fairly small, and in most cases it will probably fix behaviors in a way
that doesn't cause problems for the app.
We should consider if this property should be on for all ASDisplayNodes,
but for now it would be a great step to be confident it's on for all
ASImageNodes.
One of the reports of this issue:
facebookarchive/AsyncDisplayKit#490