From cac85402a3d437c8a379d3a857fbfa56fd8dfb0a Mon Sep 17 00:00:00 2001 From: TZGyn Date: Mon, 26 Oct 2026 21:14:51 +0800 Subject: [PATCH] Remember the Actual Size view choice Persist the magnifier state in UserDefaults so every new result window opens in the same mode and the choice survives relaunches. Generated with OpenCode Assisted-by: Kimi:k3 --- Sources/Kapture/ResultWindow.swift | 6 +++++- build-app.sh | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/Kapture/ResultWindow.swift b/Sources/Kapture/ResultWindow.swift index f95965d..e24e4bf 100644 --- a/Sources/Kapture/ResultWindow.swift +++ b/Sources/Kapture/ResultWindow.swift @@ -120,7 +120,11 @@ final class CaptureModel: ObservableObject { /// Whether the pen is active (drag draws instead of selecting) @Published var tool: Tool = .select /// Actual-size view: 1 image pixel per screen pixel, scrollable. - @Published var isActualSize = false + /// Persisted so the choice carries over to new windows and launches. + @Published var isActualSize: Bool = UserDefaults.standard.bool(forKey: CaptureModel.actualSizeKey) { + didSet { UserDefaults.standard.set(isActualSize, forKey: CaptureModel.actualSizeKey) } + } + private static let actualSizeKey = "actualSizeView" /// Current drawing color @Published var drawColor: NSColor = .systemRed /// Stroke thickness in points (image space) diff --git a/build-app.sh b/build-app.sh index bd4b74e..49c4aac 100755 --- a/build-app.sh +++ b/build-app.sh @@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST' CFBundleIconFile Icon CFBundleShortVersionString - 1.11.2 + 1.11.3 CFBundleVersion - 112 + 113 LSUIElement NSHighResolutionCapable