fix: align text annotations in captures

This commit is contained in:
2026-07-08 14:46:57 +08:00
parent f90612976f
commit 7b290d9300
7 changed files with 533 additions and 130 deletions
+23 -65
View File
@@ -77,6 +77,24 @@ interface OverlayPayload {
}
const overlayPayload = ref<OverlayPayload | null>(null)
interface OverlayAnnotation {
tool: string
color: string
points: Array<{ x: number; y: number }>
text?: string
fontSize?: number
}
interface OverlayResult {
rect: {
x: number
y: number
w: number
h: number
}
annotations: OverlayAnnotation[]
}
const capturing = ref(false)
const toast = ref<{ kind: 'success' | 'error'; text: string } | null>(null)
@@ -121,19 +139,7 @@ async function retryHotkey() {
}
}
async function onOverlayConfirm(rect: {
rect: {
x: number
y: number
w: number
h: number
}
annotations: Array<{
tool: string
color: string
points: Array<{ x: number; y: number }>
}>
}) {
async function onOverlayConfirm(rect: OverlayResult) {
// Optimistically swap back so the window does not visually lag the
// Go-side hide. If upload fails, the toast surfaces the reason.
mode.value = 'settings'
@@ -145,19 +151,7 @@ async function onOverlayConfirm(rect: {
}
}
async function onOverlayCopy(rect: {
rect: {
x: number
y: number
w: number
h: number
}
annotations: Array<{
tool: string
color: string
points: Array<{ x: number; y: number }>
}>
}) {
async function onOverlayCopy(rect: OverlayResult) {
mode.value = 'settings'
overlayPayload.value = null
try {
@@ -167,19 +161,7 @@ async function onOverlayCopy(rect: {
}
}
async function onOverlaySave(rect: {
rect: {
x: number
y: number
w: number
h: number
}
annotations: Array<{
tool: string
color: string
points: Array<{ x: number; y: number }>
}>
}) {
async function onOverlaySave(rect: OverlayResult) {
mode.value = 'settings'
overlayPayload.value = null
try {
@@ -189,19 +171,7 @@ async function onOverlaySave(rect: {
}
}
async function onOverlaySaveRemote(rect: {
rect: {
x: number
y: number
w: number
h: number
}
annotations: Array<{
tool: string
color: string
points: Array<{ x: number; y: number }>
}>
}) {
async function onOverlaySaveRemote(rect: OverlayResult) {
mode.value = 'settings'
overlayPayload.value = null
try {
@@ -211,19 +181,7 @@ async function onOverlaySaveRemote(rect: {
}
}
async function onOverlaySummarize(rect: {
rect: {
x: number
y: number
w: number
h: number
}
annotations: Array<{
tool: string
color: string
points: Array<{ x: number; y: number }>
}>
}) {
async function onOverlaySummarize(rect: OverlayResult) {
mode.value = 'settings'
overlayPayload.value = null
try {