I
I
Igor Braduloff2019-10-21 16:23:24
Canvas
Igor Braduloff, 2019-10-21 16:23:24

Why is there an error in fillRect()?

Good afternoon! Can't draw using Canvas. I am getting Uncaught TypeError: ctx.flllRect is not a function at HTMLCanvasElement.canvas.onmousedown
My code:

var canvas = document.getElementById('c1');
var ctx = canvas.getContext('2d');
canvas.onmousemove = function(event){
  canvas.onmousedown = function(event){
    var x = event.offsetX;
    var y = event.offsetY;
    console.log(x);
    console.log(y);
    ctx.flllRect(x-5,y-5,5,5);
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-10-21
@pandinus

ctx.f l llRect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question