Skip to content

Commit

Permalink
1. 修复了在FM模式下状态栏控制按钮点击错位的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stark81 committed May 30, 2023
1 parent 48fbd5c commit 7299ced
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yesplaymusic",
"version": "0.4.7",
"version": "0.4.8",
"private": true,
"description": "A third party music player for Netease Music",
"author": "qier222<[email protected]>",
Expand Down
6 changes: 4 additions & 2 deletions src/electron/macStatusBarLyric.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ export default function initMacStatusbarLyric() {
changeStatus({ changeControl: true });
});
ipcRenderer.on('trayClick', (event, { position }) => {
const x_add = player.isPersonalFM ? 14 : 0;
if (lyricShow && controlShow) {
const x = position.x - LyricIcon.canvas.width / TrayIcon.devicePixelRatio;
const x =
position.x - LyricIcon.canvas.width / TrayIcon.devicePixelRatio - x_add;
if (x > 0) {
switch (parseInt(x / ControlIcon.singleWidth)) {
case 0:
Expand Down Expand Up @@ -195,7 +197,7 @@ export default function initMacStatusbarLyric() {
}
}
} else if (controlShow) {
const x = position.x;
const x = position.x - x_add;
switch (parseInt(x / ControlIcon.singleWidth)) {
case 0:
if (player.isPersonalFM) {
Expand Down

0 comments on commit 7299ced

Please sign in to comment.