Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
924a692f2b | ||
|
|
ae054d70b9 |
@@ -329,8 +329,11 @@ final class CaptureController: NSObject {
|
|||||||
// An overlapping window from the same app means this is an
|
// An overlapping window from the same app means this is an
|
||||||
// owned popup — desktopIndependentWindow would composite the
|
// owned popup — desktopIndependentWindow would composite the
|
||||||
// parent too, so capture the screen crop instead.
|
// parent too, so capture the screen crop instead.
|
||||||
|
// Owned popups composite their parent even when the windows
|
||||||
|
// don't overlap, so ANY other same-app window on screen means
|
||||||
|
// crop (correct region) instead of the group composite.
|
||||||
let ownedRisk = trackedWindows.contains {
|
let ownedRisk = trackedWindows.contains {
|
||||||
$0.id != hover.id && $0.pid == hover.pid && $0.frame.intersects(hover.frame)
|
$0.id != hover.id && $0.pid == hover.pid
|
||||||
}
|
}
|
||||||
CaptureController.log("tap: window pick id=\(hover.id) pid=\(hover.pid) ownedRisk=\(ownedRisk) \(hover.frame)")
|
CaptureController.log("tap: window pick id=\(hover.id) pid=\(hover.pid) ownedRisk=\(ownedRisk) \(hover.frame)")
|
||||||
finishWindowPick(hover.id, hover.frame, ownedRisk: ownedRisk)
|
finishWindowPick(hover.id, hover.frame, ownedRisk: ownedRisk)
|
||||||
@@ -399,23 +402,19 @@ final class ScreenCapture {
|
|||||||
// Apply a rounded-corner alpha mask for window captures, matching
|
// Apply a rounded-corner alpha mask for window captures, matching
|
||||||
// macOS window chrome (≈10pt radius, scaled to image pixels).
|
// macOS window chrome (≈10pt radius, scaled to image pixels).
|
||||||
if roundedCorners {
|
if roundedCorners {
|
||||||
|
// Clip to a rounded rect and redraw — deterministic corner alpha
|
||||||
|
// (masking() can fail depending on the source pixel format).
|
||||||
let radius = 10 * scaleX
|
let radius = 10 * scaleX
|
||||||
let maskRect = CGRect(x: 0, y: 0, width: result.width, height: result.height)
|
guard let ctx = CGContext(
|
||||||
guard let maskCtx = CGContext(
|
|
||||||
data: nil, width: result.width, height: result.height,
|
data: nil, width: result.width, height: result.height,
|
||||||
bitsPerComponent: 8, bytesPerRow: 0,
|
bitsPerComponent: 8, bytesPerRow: 0,
|
||||||
space: CGColorSpaceCreateDeviceRGB(),
|
space: CGColorSpaceCreateDeviceRGB(),
|
||||||
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue
|
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue
|
||||||
) else { return result }
|
) else { return result }
|
||||||
maskCtx.setFillColor(CGColor(gray: 1, alpha: 1))
|
ctx.addPath(CGPath(roundedRect: CGRect(x: 0, y: 0, width: result.width, height: result.height), cornerWidth: radius, cornerHeight: radius, transform: nil))
|
||||||
maskCtx.fill(maskRect)
|
ctx.clip()
|
||||||
maskCtx.setBlendMode(.clear)
|
ctx.draw(result, in: CGRect(x: 0, y: 0, width: result.width, height: result.height))
|
||||||
maskCtx.setFillColor(CGColor(gray: 0, alpha: 1))
|
if let masked = ctx.makeImage() {
|
||||||
maskCtx.addPath(CGPath(roundedRect: maskRect, cornerWidth: radius, cornerHeight: radius, transform: nil))
|
|
||||||
maskCtx.fillPath()
|
|
||||||
maskCtx.setBlendMode(.normal)
|
|
||||||
if let mask = maskCtx.makeImage(),
|
|
||||||
let masked = result.masking(mask) {
|
|
||||||
result = masked
|
result = masked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -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.8.2</string>
|
<string>1.8.4</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>82</string>
|
<string>84</string>
|
||||||
<key>LSUIElement</key>
|
<key>LSUIElement</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user