canvas sawtooth

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/hua_ban_yu/article/details/87804347

When to draw graphics using canvas zai findings show that with some of the jagged, the visual effect is very bad

It may be used in js .translate by using (0.5, 0.5) at the serrated clear

Code:

let canvas = document.createElement("canvas");

let cirCtx = canvas.getContext("2d")

cirCtx.translate(0.5, 0.5); //使用translate(0.5,0.5)去掉锯齿

 

Guess you like

Origin blog.csdn.net/hua_ban_yu/article/details/87804347