HTML5 canvas ignores width and height set in JavaScript (solved)
HTML5 canvas ignores width and height set in JavaScript (solved)
BY 29 Jun 2013Web Application Development
Hello,
I’m using a HTML5 canvas to draw on but everything is scaled to 150% and positioned at 150% of what is specified. For example, on the screen the canvas has size (450, 450) although in the JavaScript source the size is set to (300, 300).
Adding the viewport tag to the head tag in the index.html file solved the problem: meta name=”viewport” content=”width=480, height=800, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0″
HTML5 canvas ignores width and height set in JavaScript (solved)
Hello,
I’m using a HTML5 canvas to draw on but everything is scaled to 150% and positioned at 150% of what is specified. For example, on the screen the canvas has size (450, 450) although in the JavaScript source the size is set to (300, 300).
Adding the viewport tag to the head tag in the index.html file solved the problem: meta name=”viewport” content=”width=480, height=800, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0″
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio