Our code uses a bunch of ctx, whether it is updating the canvas, or drawing overlays on it. However, our usage of ctx varies heavily from place to place, using a very inconsistent combination of both this.ctx and canvas.getContext('2d'). This is partly a fault on TypeScript, as if canvas.getContext('2d') returns a ctx, then there's no way that it can return anything else unless a previous type of context was acquired from the ctx. I propose that eventually (definitely not right now), we should cleanup the code and decide how exactly we want to use this.ctx going forward.
Our code uses a bunch of
ctx, whether it is updating the canvas, or drawing overlays on it. However, our usage ofctxvaries heavily from place to place, using a very inconsistent combination of boththis.ctxandcanvas.getContext('2d'). This is partly a fault on TypeScript, as ifcanvas.getContext('2d')returns actx, then there's no way that it can return anything else unless a previous type of context was acquired from thectx. I propose that eventually (definitely not right now), we should cleanup the code and decide how exactly we want to usethis.ctxgoing forward.