Skip to content

Commit

Permalink
Fixed a bug with the separator display in the skin tone selection ele…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
izyumkin committed Feb 28, 2023
1 parent 56027f3 commit 38f0bd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MCEmojiPicker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MCEmojiPicker'
s.version = '1.1'
s.version = '1.1.1'
s.license = 'MIT'
s.summary = 'Emoji picker for iOS like on MacOS'
s.homepage = 'https://github.com/izyumkin/MCEmojiPicker'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ final class MCEmojiSkinTonePickerView: UIView {
let separatorSpacing = Constants.separatorInset * 2 + Constants.separatorWidth
let itemsSpacing = Constants.stackViewSpacing * Double(MCEmojiSkinTone.allCases.count - 2)
let allSpacings = separatorSpacing + itemsSpacing + Constants.horizontalAmountInset
let itemWidth = (backgroundView.contentFrame.width - allSpacings) / Double(MCEmojiSkinTone.allCases.count)
let itemWidth = round((backgroundView.contentFrame.width - allSpacings) / Double(MCEmojiSkinTone.allCases.count))
let stackViewWidth = (Constants.stackViewSpacing * 4) + (itemWidth * Double(MCEmojiSkinTone.allCases.count)) + separatorSpacing

var arrangedSubviews: [UIView] = MCEmojiSkinTone.allCases.map({
let label = UILabel()
Expand Down Expand Up @@ -208,9 +209,9 @@ final class MCEmojiSkinTonePickerView: UIView {
contentStackView.alignment = .center
contentStackView.spacing = Constants.stackViewSpacing
contentStackView.frame = .init(
x: Constants.horizontalAmountInset / 2,
x: (backgroundView.bounds.size.width - stackViewWidth) / 2,
y: Constants.topInset,
width: backgroundView.contentFrame.width - Constants.horizontalAmountInset,
width: stackViewWidth,
height: itemHeight
)
contentStackView.setCustomSpacing(Constants.separatorInset, after: separatorView)
Expand Down

0 comments on commit 38f0bd8

Please sign in to comment.