From 04afa61d55d66b87f22a3b074d33d243c4b50cca Mon Sep 17 00:00:00 2001 From: fullex <106392080+0xfullex@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:50:37 +0800 Subject: [PATCH] fix(SelectionService): actionWindow show in center screen when in multi screen (#8133) fix(SelectionService): round center coordinates for action window positioning --- src/main/services/SelectionService.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/services/SelectionService.ts b/src/main/services/SelectionService.ts index 718025cd89..21520a3735 100644 --- a/src/main/services/SelectionService.ts +++ b/src/main/services/SelectionService.ts @@ -1257,14 +1257,15 @@ export class SelectionService { // Center of the screen if (!this.isFollowToolbar || !this.toolbarWindow) { - const centerX = workArea.x + (workArea.width - actionWindowWidth) / 2 - const centerY = workArea.y + (workArea.height - actionWindowHeight) / 2 + const centerX = Math.round(workArea.x + (workArea.width - actionWindowWidth) / 2) + const centerY = Math.round(workArea.y + (workArea.height - actionWindowHeight) / 2) + actionWindow.setPosition(centerX, centerY, false) actionWindow.setBounds({ width: actionWindowWidth, height: actionWindowHeight, - x: Math.round(centerX), - y: Math.round(centerY) + x: centerX, + y: centerY }) } else { // Follow toolbar position