Center the phone screen preview

This commit is contained in:
James Babcock committed 2026-10-12 17:12:36 -07:00
1 parent f6201d8e41
commit 96e3bd95f7
18 files changed
+311 -24

No files matched your search

+3 -3
View File
@@ -489,13 +489,13 @@ export class FaceclawCommunicatorBridge {
});
}
/** Phone-UI preview of the current composited screen, or null if none yet. */
getCompositePreview(green = false): ImageSource | null {
/** Phone-UI preview of the current composited screen (or of `crop`'s area of it), or null if none yet. */
getCompositePreview(green = false, crop: { x: number; y: number; width: number; height: number } | null = null): ImageSource | null {
const frame = this.communicator.previewComposite();
if (!frame) return null;
const width = Number(this.communicator.compositeWidth()), height = Number(this.communicator.compositeHeight());
if (width <= 0 || height <= 0) return null;
return previewPixels(fromData(frame.pixels), width, height, green);
return previewPixels(fromData(frame.pixels), width, height, green, crop);
}
/** Save the current composite as a 4-bit grayscale PNG under Documents; returns the path (empty if none). Cropping is not supported on iOS. */