Я рисую изображения на холст следующим образом:
ctx.drawImage(data[i].image, data[i].pos.x, data[i].pos.y, data[i].pos.w, data[i].pos.h);
Дело в том, что картина растягивается, и я не хочу этого. Как я могу имитировать свойство css
background-size: cover
при рисовании изображения в кавах.
http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-size&preval=cover
см. разницу между 100% 100%
(что у меня есть) и cover
(моя цель).