Crop screenshots

This commit is contained in:
James Babcock committed 2026-08-02 19:36:16 -07:00
1 parent 0f4adb0e86
commit 1ec6b3ff83
5 files changed
+85 -10

No files matched your search

+10 -2
View File
@@ -429,9 +429,17 @@ export class FaceclawCommunicatorBridge {
}
/** Save the current composite as a 4-bit grayscale PNG; returns the path (empty if none). */
saveScreenshot(): string {
saveScreenshot(crop?: { x: number; y: number; width: number; height: number }): string {
if (!global.isAndroid) return "";
return String(this.communicator.saveCompositePngScreenshot());
if (!crop) return String(this.communicator.saveCompositePngScreenshot());
return String(
this.communicator.saveCompositePngScreenshot(
Math.round(crop.x),
Math.round(crop.y),
Math.round(crop.width),
Math.round(crop.height),
),
);
}
/** Begin collecting composite frames for an animated-GIF screen recording. */