| 1 | import type { PreviewViewportSetting } from "@t3tools/contracts"; |
| 2 | |
| 3 | export async function commitViewportAndAspectRatio( |
| 4 | setting: PreviewViewportSetting, |
| 5 | aspectRatio: number | null, |
| 6 | onChange: (setting: PreviewViewportSetting) => Promise<void>, |
| 7 | onAspectRatioChange: (aspectRatio: number | null) => void, |
| 8 | ): Promise<void> { |
| 9 | await onChange(setting); |
| 10 | onAspectRatioChange(aspectRatio); |
| 11 | } |