kinetic-slider
Version:
A WebGL-powered kinetic slider component using PIXI.js
12 lines (11 loc) • 523 B
TypeScript
/**
* Calculates the scale factor for an image to fit inside a container
* while preserving its aspect ratio.
*
* @param imageWidth - The width of the image.
* @param imageHeight - The height of the image.
* @param containerWidth - The width of the container.
* @param containerHeight - The height of the container.
* @returns The scale factor to apply to the image.
*/
export declare function calculateSpriteScale(imageWidth: number, imageHeight: number, containerWidth: number, containerHeight: number): number;