mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 05:09:09 +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
|
// 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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user