From fc77dbc73b2ebf41ecb9e0de779261707a4c7c6e Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 19 Sep 2020 16:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/modules/winLyric/utils.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/modules/winLyric/utils.js b/src/main/modules/winLyric/utils.js index b773ce87..a82c1a23 100644 --- a/src/main/modules/winLyric/utils.js +++ b/src/main/modules/winLyric/utils.js @@ -16,17 +16,17 @@ exports.getLyricWindowBounds = (bounds, { x = 0, y = 0, w = 0, h = 0 }) => { if (w > wasW + offset) w = wasW + offset if (h > wasH + offset) h = wasH + offset if (x == null) { - if (global.appSetting.desktopLyric.x > wasW - w) { - x = wasW - w - global.appSetting.desktopLyric.x - } else if (global.appSetting.desktopLyric.x < -offset) { - x = global.appSetting.desktopLyric.x + offset + if (bounds.x > wasW - w) { + x = wasW - w - bounds.x + } else if (bounds.x < -offset) { + x = bounds.x + offset } else { x = 0 } - if (global.appSetting.desktopLyric.y > wasH - h) { - y = wasH - h - global.appSetting.desktopLyric.y - } else if (global.appSetting.desktopLyric.y < -offset) { - y = global.appSetting.desktopLyric.y + offset + if (bounds.y > wasH - h) { + y = wasH - h - bounds.y + } else if (bounds.y < -offset) { + y = bounds.y + offset } else { y = 0 }