fix width calculation

This commit is contained in:
Nihaal Sharma committed 2026-04-29 11:09:01 +01:00
1 parent 7f24277728
commit 3047f24ad7
2 files changed
+3 -3

No files matched your search

@@ -76,7 +76,7 @@ struct EmojiPackDetailView: View {
hoarder: hoarder, hoarder: hoarder,
items: pack.items, items: pack.items,
pack: pack, pack: pack,
width: 80, width: 75,
style: .full style: .full
) )
@@ -74,7 +74,7 @@ struct EmojiCollectionView: UIViewRepresentable {
self.width = width self.width = width
self.style = style self.style = style
layout.itemSize = CGSize(width: width, height: width) layout.minimumInteritemSpacing = 8
super.init(collectionViewLayout: layout) super.init(collectionViewLayout: layout)
collectionView.contentInset = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16) collectionView.contentInset = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16)
@@ -120,7 +120,7 @@ struct EmojiCollectionView: UIViewRepresentable {
let totalWidth = collectionView.bounds.width let totalWidth = collectionView.bounds.width
let availWidth = totalWidth-(collectionView.contentInset.left*2) let availWidth = totalWidth-(collectionView.contentInset.left*2)
let cols = max(1, floor(availWidth/width)) let cols = max(1, floor(availWidth/width))
let totalSpacing = 1 * (cols - 1) let totalSpacing = layout.minimumInteritemSpacing * (cols - 1)
let itemWidth = (availWidth-totalSpacing)/cols let itemWidth = (availWidth-totalSpacing)/cols
let defaultSize = CGSize(width: itemWidth, height: itemWidth) let defaultSize = CGSize(width: itemWidth, height: itemWidth)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.