Compare commits

..
1 Commits
Author SHA1 Message Date
TZGyn f50057d951 Fix screenshot offset after pixel-exact crop change
The new CGImage.cropping path expects a top-left pixel rect; the previous
CGContext redraw had implicitly flipped Y. Keep the existing SCDisplay-space
conversion so the crop matches the selected region.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4-flash-0731
2026-08-23 13:23:37 +08:00
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -124,6 +124,9 @@ final class ScreenCapture {
let scaleX = CGFloat(image.width) / display.frame.width let scaleX = CGFloat(image.width) / display.frame.width
let scaleY = CGFloat(image.height) / display.frame.height let scaleY = CGFloat(image.height) / display.frame.height
guard scaleX > 0, scaleY > 0 else { return nil } guard scaleX > 0, scaleY > 0 else { return nil }
// pxRect is in image pixel space with a TOP-LEFT origin (SCDisplay space).
// CGImage.cropping(to:) expects the same top-left rect, so no Y flip
// is needed here — this preserves the previous CGContext behavior.
let pxRect = CGRect( let pxRect = CGRect(
x: (cgRect.minX - display.frame.minX) * scaleX, x: (cgRect.minX - display.frame.minX) * scaleX,
y: (cgRect.minY - display.frame.minY) * scaleY, y: (cgRect.minY - display.frame.minY) * scaleY,
+2 -2
View File
@@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST'
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>Icon</string> <string>Icon</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.3.0</string> <string>1.3.1</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>30</string> <string>31</string>
<key>LSUIElement</key> <key>LSUIElement</key>
<true/> <true/>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>