Skip to content

Commit

Permalink
Fix incorrect size issue
Browse files Browse the repository at this point in the history
Modify the function of getting size to make it right.
  • Loading branch information
AlancLiu authored May 2, 2017
1 parent 7cefe05 commit e50a8e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion LiveLabel/LiveLabel/LyricLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class LyricLabel: UILabel {
override func draw(_ rect: CGRect) {
super.draw(rect)

var size = self.frame.size
let myString: NSString = self.text! as NSString
var size: CGSize = myString.size(attributes: [NSFontAttributeName: UIFont.boldSystemFont(ofSize: self.font.pointSize)])
size.height = rect.height;
// var size = rect.size;

// Draw solid color filled image
size.width = max(1, size.width * (CGFloat(progress) * 0.01))
Expand Down

0 comments on commit e50a8e0

Please sign in to comment.