feat(app): support to edit screenshot area

- relocate or resize the area
- add anotations on the area
This commit is contained in:
2026-06-01 23:12:54 +08:00
parent ceecbb6af4
commit c45864e44c
9 changed files with 1234 additions and 133 deletions
+10 -6
View File
@@ -5,7 +5,7 @@ package main
import "C"
//export nativeOverlayConfirm
func nativeOverlayConfirm(x, y, w, h C.int) {
func nativeOverlayConfirm(x, y, w, h C.int, annotationsJSON *C.char) {
nativeOverlayState.Lock()
app := nativeOverlayState.app
nativeOverlayState.app = nil
@@ -13,12 +13,16 @@ func nativeOverlayConfirm(x, y, w, h C.int) {
if app == nil {
return
}
rawAnnotations := C.GoString(annotationsJSON)
go func() {
_ = app.ConfirmNativeRegion(RegionRect{
X: int(x),
Y: int(y),
W: int(w),
H: int(h),
_ = app.ConfirmNativeRegion(CaptureResult{
Rect: RegionRect{
X: int(x),
Y: int(y),
W: int(w),
H: int(h),
},
Annotations: parseNativeAnnotations(rawAnnotations),
})
}()
}