Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 5129708

Browse files
committed
Merge pull request #535 from eanagel/cell-clipsToBounds
Propagate ASCellNode's clipsToBounds value to the __ASTableViewCell
2 parents 8beae28 + 4963a88 commit 5129708

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

AsyncDisplayKit/ASCellNode.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ - (instancetype)init
2525

2626
// use UITableViewCell defaults
2727
_selectionStyle = UITableViewCellSelectionStyleDefault;
28+
self.clipsToBounds = YES;
2829

2930
return self;
3031
}

AsyncDisplayKit/ASTableView.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
389389
cell.backgroundColor = node.backgroundColor;
390390
cell.selectionStyle = node.selectionStyle;
391391

392+
// the following ensures that we clip the entire cell to it's bounds if node.clipsToBounds is set (the default)
393+
// This is actually a workaround for a bug we are seeing in some rare cases (selected background view
394+
// overlaps other cells if size of ASCellNode has changed.)
395+
cell.clipsToBounds = node.clipsToBounds;
396+
392397
return cell;
393398
}
394399

0 commit comments

Comments
 (0)