( imageWidth: number, imageHeight: number, screenWidth: number, )
| 86 | } |
| 87 | |
| 88 | export function scaleFrame( |
| 89 | imageWidth: number, |
| 90 | imageHeight: number, |
| 91 | screenWidth: number, |
| 92 | ) { |
| 93 | return function scaledFrame(frame?: Frame): Frame | undefined { |
| 94 | if (!frame) { |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | const portrait = imageHeight > imageWidth; |
| 99 | |
| 100 | if (portrait) { |
| 101 | return scaleFramePortrait(screenWidth, imageWidth, imageHeight, frame); |
| 102 | } |
| 103 | |
| 104 | return rotateFrame( |
| 105 | scaleFramePortrait( |
| 106 | screenWidth, |
| 107 | imageHeight, |
| 108 | imageWidth, |
| 109 | rotateFrame(frame), |
| 110 | ), |
| 111 | ); |
| 112 | }; |
| 113 | } |
no test coverage detected