Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ Pods/
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build

.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ class ProgressAtRatioView: UIView {
ratioLabel.font = prop.ratioLabelFont
ratioLabel.textAlignment = NSTextAlignment.right
ratioLabel.textColor = prop.ratioLabelFontColor
ratioLabel.sizeToFit()
ratioLabel.frame.size = (ratioLabel.text as! NSString).boundingRect(
with: CGSize(width: prop.progressSize, height: CGFloat.infinity),
options: .usesLineFragmentOrigin,
attributes: [.font: ratioLabel.font],
context: nil).size
ratioLabel.center = center
ratioLabel.adjustsFontSizeToFitWidth = true

addSubview(ratioLabel)
}
Expand Down
7 changes: 6 additions & 1 deletion source/Progress/Core/ProgressAtRatioView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ class ProgressAtRatioView: UIView {
ratioLabel.font = prop.ratioLabelFont
ratioLabel.textAlignment = NSTextAlignment.right
ratioLabel.textColor = prop.ratioLabelFontColor
ratioLabel.sizeToFit()
ratioLabel.frame.size = (ratioLabel.text as! NSString).boundingRect(
with: CGSize(width: prop.progressSize, height: CGFloat.infinity),
options: .usesLineFragmentOrigin,
attributes: [.font: ratioLabel.font],
context: nil).size
ratioLabel.center = center
ratioLabel.adjustsFontSizeToFitWidth = true

addSubview(ratioLabel)
}
Expand Down