diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2022-12-02 23:55:28 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2022-12-03 15:46:58 +0000 |
| commit | d3ef8e65dccb76c4a62d7c4f8f38c9fa3dd9b188 (patch) | |
| tree | 3ee05dc8d782353ed6c1862acb36b83f65331fba /malloc.c | |
| parent | f0d47053640c18d99252a57466272f53fbabac25 (diff) | |
| download | puzzles-d3ef8e65dccb76c4a62d7c4f8f38c9fa3dd9b188.zip puzzles-d3ef8e65dccb76c4a62d7c4f8f38c9fa3dd9b188.tar.gz puzzles-d3ef8e65dccb76c4a62d7c4f8f38c9fa3dd9b188.tar.bz2 puzzles-d3ef8e65dccb76c4a62d7c4f8f38c9fa3dd9b188.tar.xz | |
js: Simplify drawing context management
There's not much point in re-requesting the drawing context from the
offscreen canvas at the start of each drawing operation. The canvas
keeps the context around and returns it on every call to getContext(),
so we may as well just keep our reference to it too. This does mean
that the front-end won't detect puzzles drawing outside of a redraw
operation, but I think it's the mid-end's job to assert things like
that.
Rumours that I'm doing this because I had a mysterious bug whereby ctx
was unexpectedly null are entirely true.
Diffstat (limited to 'malloc.c')
0 files changed, 0 insertions, 0 deletions