From f8c3a97c5a8095398b34ed53a41dd3355510b818 Mon Sep 17 00:00:00 2001 From: Piotr Kochanowski <63232710+TheKohan@users.noreply.github.com> Date: Fri, 3 Jan 2025 08:16:29 +0100 Subject: [PATCH] Update maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt Co-authored-by: Dan Caseley Co-authored-by: Amanjeet Singh --- .../src/main/java/maestro/orchestra/Orchestra.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt b/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt index d053aa19a3..cac56f3ee9 100644 --- a/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt +++ b/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt @@ -819,12 +819,16 @@ class Orchestra( ?.let { File(it, pathStr) } ?: File(pathStr) - if(cropped == null){ + if (cropped == null) { maestro.takeScreenshot(file.sink(), false) - }else{ + } else { maestro.takePartialScreenshot(sink = file.sink(), bounds = cropped.element.bounds, compressed = false) + if (cropped == null){ + maestro.takeScreenshot(file.sink(), false) + } else { + maestro.takePartialScreenshot(sink = file.sink(), bounds = cropped.element.bounds, compressed = false) + } } - return false }