( deviceNaturalSize: Size | null, chromeProfile: ChromeProfile | null, rotationQuarterTurns = 0, )
| 21 | } |
| 22 | |
| 23 | export function shellSize( |
| 24 | deviceNaturalSize: Size | null, |
| 25 | chromeProfile: ChromeProfile | null, |
| 26 | rotationQuarterTurns = 0, |
| 27 | ): Size { |
| 28 | const naturalSize = |
| 29 | chromeProfile?.totalWidth && chromeProfile?.totalHeight |
| 30 | ? { |
| 31 | height: chromeProfile.totalHeight, |
| 32 | width: chromeProfile.totalWidth, |
| 33 | } |
| 34 | : (() => { |
| 35 | const aspectRatio = deviceNaturalSize |
| 36 | ? deviceNaturalSize.height / deviceNaturalSize.width |
| 37 | : 2.16; |
| 38 | const screenHeight = DEVICE_SCREEN_WIDTH * aspectRatio; |
| 39 | return { |
| 40 | height: screenHeight, |
| 41 | width: DEVICE_SCREEN_WIDTH, |
| 42 | }; |
| 43 | })(); |
| 44 | |
| 45 | return rotateSize(naturalSize, rotationQuarterTurns); |
| 46 | } |
| 47 | |
| 48 | export function buildShellRotationTransform( |
| 49 | deviceNaturalSize: Size | null, |
no test coverage detected