aspect-fill

Returns scale and dimensions of a rectangular area that fills the parent area.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
aspect-fill
101.0.18 years ago9 years agoMinified + gzip package size for aspect-fill in KB

Readme

aspect-fill
!build status12
!browser support34
Returns scale and dimensions of a rectangular area that fills the parent area.
See aspect-fit for a fit calculation

Example

var fill = require("aspect-fill")
// fill(areaWidth, areaHeight, parentWidth, parentHeight);
var fillResult = fill(400, 200, 800, 400);
// fillResult == {scale:2, width:800, height:400}

Installation

npm install aspect-fill

Contributors

- maxtherocket

MIT Licenced

1: https://secure.travis-ci.org/maxtherocket/aspect-fill.png 2: http://travis-ci.org/maxtherocket/aspect-fill 3: http://ci.testling.com/maxtherocket/aspect-fill.png 4: http://ci.testling.com/maxtherocket/aspect-fill