Skip to content

Commit

Permalink
Bug fixed and Improve animation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelRow authored and MichaelRow committed Dec 23, 2015
1 parent 634f6fa commit a642c45
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Lyrics/LyricsWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class LyricsWindowController: NSWindowController {
let visibleFrame:NSRect=(NSScreen.mainScreen()?.visibleFrame)!
visibleSize=visibleFrame.size
visibleOrigin=visibleFrame.origin
self.window?.setFrame(CGRectMake(0, 0, visibleSize.width, visibleSize.height), display: true)
self.window?.setFrame((NSScreen.mainScreen()?.frame)!, display: true)
firstLyricsLayer.contentsScale=(NSScreen.mainScreen()?.backingScaleFactor)!
secondLyricsLayer.contentsScale=firstLyricsLayer.contentsScale
NSLog("Screen Visible Res Changed to:(%f,%f) O:(%f,%f)", visibleSize.width,visibleSize.height,visibleOrigin.x,visibleOrigin.y)
Expand Down Expand Up @@ -305,7 +305,7 @@ class LyricsWindowController: NSWindowController {
if x < 4 {
x = 4
}
height=size1st.height+size2nd.height
height=rect1st.size.height+rect2nd.size.height

} else {
x = CGFloat(userDefaults.integerForKey(LyricsConstToLeft))
Expand Down Expand Up @@ -403,11 +403,10 @@ class LyricsWindowController: NSWindowController {

//lyrics on left or right side
if userDefaults.integerForKey(LyricsVerticalLyricsPosition) == 0 {
x = 0
x = visibleOrigin.x
} else {
x = visibleSize.width - frameSize.height - bgHeightIncreasement
x = visibleOrigin.x + visibleSize.width - frameSize.height - bgHeightIncreasement - 8
}

backgroundLayer.frame = CGRectMake(x, y, frameSize.width, frameSize.height*1.15+bgHeightIncreasement)
firstLyricsLayer.frame = CGRectMake(0, -frameSize.height*0.15+yOffset, frameSize.width, frameSize.height*1.08+lyricsHeightIncreasement)
firstLyricsLayer.string=attributedStr
Expand Down Expand Up @@ -467,7 +466,7 @@ class LyricsWindowController: NSWindowController {
rect2nd.size.width = width
}

height=size1st.height+size2nd.height
height=rect1st.size.height+rect2nd.size.height
var deltaH = heightWithDock - width
if deltaH < 8 {
deltaH = 8
Expand All @@ -476,9 +475,9 @@ class LyricsWindowController: NSWindowController {

//lyrics on left or right side
if userDefaults.integerForKey(LyricsVerticalLyricsPosition) == 0 {
x = 0
x = visibleOrigin.x
} else {
x = visibleSize.width - height
x = visibleOrigin.x + visibleSize.width - height - 8
}

backgroundLayer.frame = CGRectMake(x, y, width, height*1.15)
Expand Down

0 comments on commit a642c45

Please sign in to comment.