BBC-News/Imager.js — pull request #109 by oncletom (2014-10-27 09:23:38+00:00)
Title: widthInterpolator to accept a pixelRatio parameter

The `widthInterpolator` now accepts a second parameter `pixelRatio` in addition to the existing `width` one.
It is handy if you do not build `image@2x.jpg` but rather use browser image scaling.

The following example will multiply the availableWidth by the device pixel ratio:

```js
new Imager({
availableWidths: [200, 260, 320, 600],
widthInterpolator: function(width, ratio) {
return width * ratio;
}
});

// if pixelRatio is 2, availableWidths === [400, 520, 640, 1200]
// if pixelRatio is 3, availableWidths === [600, 780, 960, 1800]
```

closes #84

![](http://tclhost.com/5LPnYTl.gif)