@@ -16,7 +16,7 @@ class CardView: UIView {
1616 update()
1717 }
1818 }
19− var width: CGFloat = 300 {
19+ var minWidth: CGFloat = 300 {
2020 didSet {
2121 update()
2222 }
@@ -84,11 +84,15 @@ class CardView: UIView {
8484 largeStack.addArrangedSubview(.spacer(vPadding1))
8585
8686
87+ let width = max(minWidth - 2 * padding.x, userView.frame.width)
88+
89+
8790 let photoView = CollectionView()
8891 photoView.alignment = .top
8992 photoView.horizontalPadding = 8
9093 photoView.verticalPadding = 8
9194 photoView.padding = CGPoint.zero
95+ photoView.maxWidth = width
9296 var maxPhotoDim: CGFloat = 150
9397 if let attachments = post?.attachments {
9498 for attachment in attachments {
@@ -98,6 +102,7 @@ class CardView: UIView {
98102 if var pWidth = photo.width.value >>> {CGFloat($0)},
99103 var pHeight = photo.height.value >>> {CGFloat($0)} {
100104 let photoV = UIImageView()
105+ photoV.layer.minificationFilter = kCAFilterTrilinear
101106 photo.image?.load(into: photoV)
102107 var k: CGFloat!
103108 if pWidth > pHeight {
@@ -123,7 +128,7 @@ class CardView: UIView {
123128 textHeight -= padding.y + vPadding1 + userView.frame.height
124129 if let count = post?.attachments.count{
125130 if count > 0 {
126− textHeight -= vPadding2 + photoView.frame.height
131+ textHeight -= vPadding2 + photoView.frame.height + padding.y
127132 }
128133 }
129134 print(textHeight)
@@ -132,7 +137,7 @@ class CardView: UIView {
132137
133138 let body = UILabel()
134139 body.numberOfLines = 0
135− let bodyWidth: Double = Double(width - padding.x * 2)
140+ let bodyWidth: Double = Double(width)
136141 body.font = UIFont.systemFont(ofSize: 22, weight: UIFontWeightSemibold)
137142 body.text = post?.body
138143 let size = body.textRect(forBounds: CGRect(x: 0, y: 0, width: bodyWidth, height: Double.infinity), limitedToNumberOfLines: 0).size
@@ -148,7 +153,7 @@ class CardView: UIView {
148153 }
149154 }
150155
151− frame.size = CGSize(width: width, height: height)
156+ frame.size = CGSize(width: width + padding.x * 2, height: height)
152157
153158 }
154159}