From 89cc2e24476503b9bd6aa13e1b29d7a87a5051c2 Mon Sep 17 00:00:00 2001 From: brianling Date: Thu, 16 Jul 2026 09:20:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A1=AE=E8=AE=A4/=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E8=B7=9F=E9=9A=8F=E6=88=AA=E5=9B=BE=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=9C=A8=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8C=BA=E5=8F=B3=E4=B8=8B=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ScreenshotOverlay.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/ScreenshotOverlay.vue b/src/components/ScreenshotOverlay.vue index cf80ace..e568fc0 100644 --- a/src/components/ScreenshotOverlay.vue +++ b/src/components/ScreenshotOverlay.vue @@ -8,7 +8,7 @@ >
拖动选择截图区域 · Esc取消
-
+
@@ -29,6 +29,21 @@ const state = { const hasSelection = ref(false) const isCapturing = ref(false) +const actionsStyle = computed(() => { + if (!hasSelection.value) return {} + const x = Math.min(state.startX, state.endX) + const y = Math.min(state.startY, state.endY) + const w = Math.abs(state.endX - state.startX) + const h = Math.abs(state.endY - state.startY) + const panelW = 160 + const gap = 8 + let left = x + w - panelW + let top = y + h + gap + if (left < 4) left = 4 + if (top + 40 > window.innerHeight) top = y - 40 - gap + return { left: left + 'px', top: top + 'px', transform: 'none', bottom: 'auto' } +}) + onMounted(() => { document.addEventListener('keydown', onKeyDown) }) @@ -172,9 +187,6 @@ function onKeyDown(e: KeyboardEvent) { .screenshot-actions { position: fixed; - bottom: 40px; - left: 50%; - transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto;