Skip to content

Commit

Permalink
Allowed orientation to disable framing
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcc007 committed Jul 17, 2019
1 parent 5afb5f3 commit 1301a74
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
17 changes: 8 additions & 9 deletions example/screenshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ staging: /tmp/screenshots

# A list of locales supported in app
locales:
- fr-CA
- en-US
- fr-CA

# A list of devices to run tests on
devices:
ios:
iPhone XS Max:
frame: false
orientation: LandscapeRight
# iPhone XS Max:
# frame: false
# orientation: LandscapeRight
iPad Pro (12.9-inch) (2nd generation):
frame: false
orientation: LandscapeRight
android:
Nexus 6P:
frame: false
orientation: LandscapeRight
# android:
# Nexus 6P:
# frame: false
# orientation: LandscapeRight

# Frame screenshots
frame: true
Expand Down
2 changes: 1 addition & 1 deletion example/screenshots_CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ locales:
# A list of devices to run tests on
devices:
ios:
iPhone XS Max:
# iPhone XS Max:
iPad Pro (12.9-inch) (2nd generation):
frame: false
android:
Expand Down
9 changes: 6 additions & 3 deletions lib/src/image_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@ class ImageProcessor {
bool isFrameRequired = config['frame'];
if (device != null) {
final isDeviceFrameRequired = device['frame'];
if (isDeviceFrameRequired != null) {
isFrameRequired = isDeviceFrameRequired;
}
// device frame over-rides global frame
isDeviceFrameRequired != null
? isFrameRequired = isDeviceFrameRequired
: null;
// orientation over-rides global and device frame setting
device['orientation'] != null ? isFrameRequired = false : null;
}
return isFrameRequired;
}
Expand Down

0 comments on commit 1301a74

Please sign in to comment.