mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
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:
parent
7549972048
commit
04afa61d55
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user