Closed ghost closed 3 years ago
Probably to use 'rc.ctx'?
rc.ctx
is not a documented property so you should not rely on that.
you have the reference to the canvasElement and can get the context yourself. In your code, you have the canvasEle
const canvasEle = document.getElementById('canvas');
const ctx = canvasEle.getContext('2d');
ctx.clearRect(.....)
I want to clear the rectangle drawn before, but it says ‘rc.clearRect is not a function’