( screenWidth: number, imageWidth: number, imageHeight: number, frame: Frame, )
| 66 | } |
| 67 | |
| 68 | function scaleFramePortrait( |
| 69 | screenWidth: number, |
| 70 | imageWidth: number, |
| 71 | imageHeight: number, |
| 72 | frame: Frame, |
| 73 | ): Frame { |
| 74 | const shown = shownDimensionsPortrait(screenWidth, imageWidth, imageHeight); |
| 75 | const point = scalePointPortrait(screenWidth, imageWidth, imageHeight, { |
| 76 | x: frame.left, |
| 77 | y: frame.top, |
| 78 | }); |
| 79 | |
| 80 | return { |
| 81 | left: point.x, |
| 82 | top: point.y, |
| 83 | width: (shown.width / imageWidth) * frame.width, |
| 84 | height: (shown.height / imageHeight) * frame.height, |
| 85 | }; |
| 86 | } |
| 87 | |
| 88 | export function scaleFrame( |
| 89 | imageWidth: number, |
no test coverage detected