problem:
Today, when I found a template for the login interface on the Internet and was going to apply it to the login interface in my project, I found that the width and height of the canvas label are not the width and height of the web page, but the original template of the web page is normally filled. Page. After searching the information, I finally learned that the original problem is the zoom ratio. Because I added a CSS style for the 125% zoom to 80% in the web project, and then calculate the width and height of the canvas in the js of the template, it is calculated error.
Solution:
Calculate the width and height in js by multiplying a scaling factor window.devicePixelRatio .