import { Size } from '@icarus/shared' ; import { LayoutTransform } from './interface' ; export const calculateCenteredTranslate = ( scale , containerValue , imageValue ) : number => { const gap = containerValue - imageValue * scale ; return gap / 2 / scale ; } ; export const calculateOneStepTransform = ( scale , containerSize , imageSize ) : LayoutTransform [ ] => [ { scale : scale , translateX : calculateCenteredTranslate ( scale , containerSize . width , imageSize . width ) , translateY : calculateCenteredTranslate ( scale , containerSize . height , imageSize . height ) , } , ] ;