优化代码
parent
8aedde2422
commit
fc77dbc73b
|
@ -16,17 +16,17 @@ exports.getLyricWindowBounds = (bounds, { x = 0, y = 0, w = 0, h = 0 }) => {
|
||||||
if (w > wasW + offset) w = wasW + offset
|
if (w > wasW + offset) w = wasW + offset
|
||||||
if (h > wasH + offset) h = wasH + offset
|
if (h > wasH + offset) h = wasH + offset
|
||||||
if (x == null) {
|
if (x == null) {
|
||||||
if (global.appSetting.desktopLyric.x > wasW - w) {
|
if (bounds.x > wasW - w) {
|
||||||
x = wasW - w - global.appSetting.desktopLyric.x
|
x = wasW - w - bounds.x
|
||||||
} else if (global.appSetting.desktopLyric.x < -offset) {
|
} else if (bounds.x < -offset) {
|
||||||
x = global.appSetting.desktopLyric.x + offset
|
x = bounds.x + offset
|
||||||
} else {
|
} else {
|
||||||
x = 0
|
x = 0
|
||||||
}
|
}
|
||||||
if (global.appSetting.desktopLyric.y > wasH - h) {
|
if (bounds.y > wasH - h) {
|
||||||
y = wasH - h - global.appSetting.desktopLyric.y
|
y = wasH - h - bounds.y
|
||||||
} else if (global.appSetting.desktopLyric.y < -offset) {
|
} else if (bounds.y < -offset) {
|
||||||
y = global.appSetting.desktopLyric.y + offset
|
y = bounds.y + offset
|
||||||
} else {
|
} else {
|
||||||
y = 0
|
y = 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue