fix(SelectionService): actionWindow show in center screen when in multi screen (#8133)

fix(SelectionService): round center coordinates for action window positioning
This commit is contained in:
fullex 2025-07-17 11:50:37 +08:00 committed by GitHub
parent 7549972048
commit 04afa61d55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1257,14 +1257,15 @@ export class SelectionService {
// Center of the screen // Center of the screen
if (!this.isFollowToolbar || !this.toolbarWindow) { if (!this.isFollowToolbar || !this.toolbarWindow) {
const centerX = workArea.x + (workArea.width - actionWindowWidth) / 2 const centerX = Math.round(workArea.x + (workArea.width - actionWindowWidth) / 2)
const centerY = workArea.y + (workArea.height - actionWindowHeight) / 2 const centerY = Math.round(workArea.y + (workArea.height - actionWindowHeight) / 2)
actionWindow.setPosition(centerX, centerY, false)
actionWindow.setBounds({ actionWindow.setBounds({
width: actionWindowWidth, width: actionWindowWidth,
height: actionWindowHeight, height: actionWindowHeight,
x: Math.round(centerX), x: centerX,
y: Math.round(centerY) y: centerY
}) })
} else { } else {
// Follow toolbar position // Follow toolbar position