All listed answers is about images. But my issue is about canvas in chrome (v.52) with transform rotate. They became jagged and all this methods can't help.
Solution that works for me:
So important code blocks:
// Unfixed version
ctx.drawImage(img, 0, 0, 335, 218);
// Fixed version
ctx.drawImage(img, 1, 1, 335, 218);
_x000D_
/* This style should be applied for fixed version */
canvas {
margin-left: -1px;
margin-top:-1px;
}
_x000D_
<!--Unfixed version-->
<canvas width="335" height="218"></canvas>
<!--Fixed version-->
<canvas width="337" height="220"></canvas>
_x000D_
Sample: https://jsfiddle.net/tLbxgusx/1/
Note: there is a lot of nested divs because it is simplified version from my project.
This issue is reproduced also for Firefox for me. There is no such issue on Safari and FF with retina.
And other founded solution is to place canvas into div of same size and apply following css to this div:
overflow: hidden;
box-shadow: 0 0 1px rgba(255,255,255,0);
// Or
//outline:1px solid transparent;
And rotation should be applied to this wrapping div. So listed solution is worked but with small modification.
And modified example for such solution is: https://jsfiddle.net/tLbxgusx/2/
Note: See style of div with class 'third'.