Skip to content

Commit

Permalink
Merge pull request #2 from AlancLiu/patch-1
Browse files Browse the repository at this point in the history
Fix incorrect size issue
  • Loading branch information
jcao-ai authored Sep 7, 2017
2 parents 7cefe05 + e50a8e0 commit 9bbd6ce
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 9bbd6ce

Please sign in to comment.