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:
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]
The
widthInterpolator
now accepts a second parameterpixelRatio
in addition to the existingwidth
one. It is handy if you do not buildimage@2x.jpg
but rather use browser image scaling.The following example will multiply the availableWidth by the device pixel ratio:
closes #84