The HTML I've used is very simple which is given below:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.sound.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
The sketch.js file is here:
function setup() {
createCanvas(500, 500);
}
function draw() {
ellipse(mouseX, mouseY, 20, 20);
}
function mousePressed() {
clear();
}
I've followed exactly as in the example, but the clear is only working on some portion of it, not the whole canvas. I tried in different browsers on different PCs, some of it works good and some are not. Also all mobile chrome browsers have the same issue.