diff --git a/src/main/apis/app/window/windowList.ts b/src/main/apis/app/window/windowList.ts index 0072c8f..6c7688c 100644 --- a/src/main/apis/app/window/windowList.ts +++ b/src/main/apis/app/window/windowList.ts @@ -235,7 +235,7 @@ windowList.set(IWindowList.RENAME_WINDOW, { if (currentWindow && currentWindow.isVisible()) { // bounds: { x: 821, y: 75, width: 800, height: 450 } const bounds = currentWindow.getBounds() - const positionX = bounds.x + bounds.width / 2 - 150 + let positionX = bounds.x + bounds.width / 2 - 150 let positionY // if is the settingWindow if (bounds.height > 400) { @@ -244,6 +244,8 @@ windowList.set(IWindowList.RENAME_WINDOW, { // if is the miniWindow positionY = bounds.y + bounds.height / 2 } + positionX = Math.floor(positionX) + positionY = Math.floor(positionY) window.setPosition(positionX, positionY, false) } } @@ -258,13 +260,15 @@ windowList.set(IWindowList.TOOLBOX_WINDOW, { const currentWindow = windowManager.getAvailableWindow(true) if (currentWindow && currentWindow.isVisible()) { const bounds = currentWindow.getBounds() - const positionX = bounds.x + bounds.width / 2 - 400 + let positionX = bounds.x + bounds.width / 2 - 400 let positionY if (bounds.height > 400) { positionY = bounds.y + bounds.height / 2 - 225 } else { positionY = bounds.y + bounds.height / 2 } + positionX = Math.floor(positionX) + positionY = Math.floor(positionY) window.setPosition(positionX, positionY, false) } } diff --git a/src/main/server/routerManager.ts b/src/main/server/routerManager.ts index 6f37b3a..71718e9 100644 --- a/src/main/server/routerManager.ts +++ b/src/main/server/routerManager.ts @@ -70,7 +70,7 @@ router.post( let needRestore = false if (picbed) { const currentPicBed = picgo.getConfig('picBed') || ({} as IStringKeyMap) - currentPicBedType = currentPicBed.current || '' + currentPicBedType = currentPicBed.uploader || currentPicBed.current || 'smms' currentPicBedConfig = currentPicBed[currentPicBedType] || ({} as IStringKeyMap) currentPicBedConfigId = currentPicBedConfig._id const configName = urlparams?.get('configName') || currentPicBed[picbed]?._configName