Merge pull request #4555 from vector-im/doug/4552_fix_attachment_view_mask

Fix image and video thumbnail masks on cell reuse.
This commit is contained in:
Doug
2021-07-15 11:23:19 +01:00
committed by GitHub
2 changed files with 4 additions and 5 deletions
+1
View File
@@ -18,6 +18,7 @@ Changes to be released in next version
* it's easy for the back button to trigger a leftpanel reveal (#4438).
* Show / hide reset button in secrets recovery screen (#4546).
* Share Extension: Fix layout when searching (#4258).
* Timeline: Fix incorrect crop of media thumbnails (#4552).
⚠️ API Changes
*
@@ -1039,12 +1039,10 @@ const CGFloat kTypingCellHeight = 24;
- (void)applyMaskToAttachmentViewOfBubbleCell:(MXKRoomBubbleTableViewCell *)cell
{
if (cell.attachmentView && !cell.attachmentView.layer.mask)
if (cell.attachmentView)
{
UIBezierPath *myClippingPath = [UIBezierPath bezierPathWithRoundedRect:cell.attachmentView.bounds cornerRadius:6];
CAShapeLayer *mask = [CAShapeLayer layer];
mask.path = myClippingPath.CGPath;
cell.attachmentView.layer.mask = mask;
cell.attachmentView.layer.cornerRadius = 6;
cell.attachmentView.layer.masksToBounds = YES;
}
}