From 1fe9539ec1ed8ed5fa4d966ba9b5c1a8eb95b465 Mon Sep 17 00:00:00 2001 From: Scott Goodson Date: Sun, 23 Jul 2017 00:08:25 -0700 Subject: [PATCH 1/2] [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. --- Source/ASImageNode.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index d36509d56..dce952d2c 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -175,7 +175,8 @@ - (instancetype)init self.contentsScale = ASScreenScale(); self.contentMode = UIViewContentModeScaleAspectFill; self.opaque = NO; - + self.clipsToBounds = YES; + // If no backgroundColor is set to the image node and it's a subview of UITableViewCell, UITableView is setting // the opaque value of all subviews to YES if highlighting / selection is happening and does not set it back to the // initial value. With setting a explicit backgroundColor we can prevent that change. From 88f94c8f6081af640bccb2250688ce84ccfb449b Mon Sep 17 00:00:00 2001 From: Scott Goodson Date: Sun, 23 Jul 2017 14:24:48 -0700 Subject: [PATCH 2/2] Update changelog for ImageNode Clipping. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b83bea11..0c01101e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASImageNode] Enabled .clipsToBounds by default, fixing the use of .cornerRadius and clipping of GIFs. [Scott Goodson](https://github.com/appleguy) [#466](https://github.com/TextureGroup/Texture/pull/466) - [ASCollectionView] Add delegate bridging and index space translation for missing UICollectionViewLayout properties. [Scott Goodson](https://github.com/appleguy) - [ASTextNode2] Add initial implementation for link handling. [Scott Goodson](https://github.com/appleguy) [#396](https://github.com/TextureGroup/Texture/pull/396) - [ASTextNode2] Provide compile flag to globally enable new implementation of ASTextNode: ASTEXTNODE_EXPERIMENT_GLOBAL_ENABLE. [Scott Goodson](https://github.com/appleguy) [#396](https://github.com/TextureGroup/Texture/pull/410)