Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Sources/CollectionViewSlantedCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,14 @@ import UIKit
*/
@objc open class CollectionViewSlantedCell: UICollectionViewCell {

/// :nodoc:
fileprivate var slantedLayerMask: CAShapeLayer?

/// :nodoc:
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
guard let mask = slantedLayerMask else {
guard let mask = layer.mask as? CAShapeLayer, let path = mask.path else {
return super.point(inside: point, with: event)
}

let bezierPath = UIBezierPath()
bezierPath.cgPath = mask.path!
bezierPath.cgPath = path
let result = bezierPath.contains(point)
return result
}
Expand All @@ -51,7 +48,6 @@ import UIKit
guard let layoutAttributes = layoutAttributes as? CollectionViewSlantedLayoutAttributes else {
return
}
slantedLayerMask = layoutAttributes.slantedLayerMask
layer.mask = layoutAttributes.slantedLayerMask
}

Expand Down