diff --git a/Classes/Issues/Merge/IssueMergeSectionController.swift b/Classes/Issues/Merge/IssueMergeSectionController.swift index f1a49176e..61c27793f 100644 --- a/Classes/Issues/Merge/IssueMergeSectionController.swift +++ b/Classes/Issues/Merge/IssueMergeSectionController.swift @@ -171,7 +171,9 @@ ListBindingSectionControllerSelectionDelegate { else { fatalError() } if let cell = cell as? CardCollectionViewCell { - cell.border = index == 0 ? .head : index == self.viewModels.count - 1 ? .tail : .neck + cell.border = index == 0 + ? index == self.viewModels.count - 1 ? .full : .head + : index == self.viewModels.count - 1 ? .tail : .neck } if let cell = cell as? IssueMergeButtonCell { cell.delegate = self diff --git a/Classes/Views/CardCollectionViewCell.swift b/Classes/Views/CardCollectionViewCell.swift index f1c11e47f..4dc032897 100644 --- a/Classes/Views/CardCollectionViewCell.swift +++ b/Classes/Views/CardCollectionViewCell.swift @@ -14,6 +14,7 @@ class CardCollectionViewCell: UICollectionViewCell, UIGestureRecognizerDelegate case head case neck case tail + case full } var border: BorderType = .neck { @@ -95,6 +96,36 @@ class CardCollectionViewCell: UICollectionViewCell, UIGestureRecognizerDelegate ) borderPath.addLine(to: CGPoint(x: pixelSnapBounds.maxX, y: bounds.minY)) + fillPath = borderPath.copy() as! UIBezierPath + fillPath.close() + case .full: + + borderPath.move(to: CGPoint(x: pixelSnapBounds.minX, y: bounds.maxY - cornerRadius)) + borderPath.addLine(to: CGPoint(x: pixelSnapBounds.minX, y: pixelSnapBounds.minY + cornerRadius)) + + borderPath.addQuadCurve( + to: CGPoint(x: pixelSnapBounds.minX + cornerRadius, y: pixelSnapBounds.minY), + controlPoint: CGPoint(x: pixelSnapBounds.minX, y: pixelSnapBounds.minY) + ) + borderPath.addLine(to: CGPoint(x: pixelSnapBounds.maxX - cornerRadius, y: pixelSnapBounds.minY)) + + borderPath.addQuadCurve( + to: CGPoint(x: pixelSnapBounds.maxX, y: pixelSnapBounds.minY + cornerRadius), + controlPoint: CGPoint(x: pixelSnapBounds.maxX, y: pixelSnapBounds.minY) + ) + borderPath.addLine(to: CGPoint(x: pixelSnapBounds.maxX, y: pixelSnapBounds.maxY - cornerRadius)) + + borderPath.addQuadCurve( + to: CGPoint(x: pixelSnapBounds.maxX - cornerRadius, y: pixelSnapBounds.maxY), + controlPoint: CGPoint(x: pixelSnapBounds.maxX, y: pixelSnapBounds.maxY) + ) + borderPath.addLine(to: CGPoint(x: pixelSnapBounds.minX + cornerRadius, y: bounds.maxY)) + + borderPath.addQuadCurve( + to: CGPoint(x: pixelSnapBounds.minX, y: pixelSnapBounds.maxY - cornerRadius), + controlPoint: CGPoint(x: pixelSnapBounds.minX, y: pixelSnapBounds.maxY) + ) + fillPath = borderPath.copy() as! UIBezierPath fillPath.close() } @@ -114,3 +145,5 @@ class CardCollectionViewCell: UICollectionViewCell, UIGestureRecognizerDelegate } } + +