math-fit
Calculates the size and the position of a target to fit a container.
Installation
With npm do:
$ npm install math-fit --save
Install with component(1):
$ component install nk-components/math-fit
Usage
var fit = ;var target = w: 200 // or width: 200 h: 100 // or height: 100;var parent = w: 200 // or width: 200 h: 200 // or height: 200; var coverValues = ; // same as fit.cover(target, parent);//// >>// {// left: float,// top: float,// width: float,// height: float,// scale: float// } var containValues = fit;
License
MIT