Answer the question
In order to leave comments, you need to log in
I drew 2 shapes through Canvas (JS). The first disappeared, the second remained. Why is that?
First I drew the first figure. Everything is correct and working. When I drew the second one, the first one disappeared. And even the second figure is drawn much lower than the first. How to fix? Help me please.
The whole code is too capacious, so I will write only the parameters that I mainly used:
context.beginPath();
context.moveTo();
context.quadraticCurveTo();
context.lineWidth = value;
context.strokeStyle = "color";
context.stroke();
window.onload = function() {
var canvas = document.getElementById("example");
var context = canvas.getContext("2d");
Answer the question
In order to leave comments, you need to log in
You do not need to start each figure with
var canvas = document.getElementById("example");
var context = canvas.getContext("2d");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question