mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Always update the path of the attachmentView's mask to handle reuse.
This commit is contained in:
@@ -1039,10 +1039,21 @@ 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];
|
||||
CAShapeLayer *mask;
|
||||
|
||||
// check for an existing mask in case the cell is being reused, otherwise create a new one
|
||||
if ([cell.attachmentView.layer.mask isKindOfClass:[CAShapeLayer class]])
|
||||
{
|
||||
mask = (CAShapeLayer*)cell.attachmentView.layer.mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
mask = [CAShapeLayer layer];
|
||||
}
|
||||
|
||||
mask.path = myClippingPath.CGPath;
|
||||
cell.attachmentView.layer.mask = mask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user