ajout app
This commit is contained in:
9
Voltaserve/ui/src/helpers/aspect-ratio.ts
Normal file
9
Voltaserve/ui/src/helpers/aspect-ratio.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function getSizeWithAspectRatio(
|
||||
srcWidth: number,
|
||||
srcHeight: number,
|
||||
maxWidth: number,
|
||||
maxHeight: number,
|
||||
) {
|
||||
const ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight)
|
||||
return { width: srcWidth * ratio, height: srcHeight * ratio }
|
||||
}
|
Reference in New Issue
Block a user