INNER CODE UNIT · TypeScript

normalizeDimensions

terrysahaidak/react-native-gallery-toolkit · packages/common/src/common.ts:7

export function normalizeDimensions(
  item: {
    width: number;
    height: number;
  },
  resultWidth = dimensions.width,
) {
  const scaleFactor = item.width / resultWidth;
  const targetHeight = item.height / scaleFactor;

  return {
    targetWidth: resultWidth,
    targetHeight,
  };
}

export function friction(value: number) {
  'worklet';

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…