diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-09-13 07:20:51 +1200 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-09-13 07:50:11 +1200 |
commit | 8de8a05ffbd622810cc23f6ae818c3bd6cfcf8a0 (patch) | |
tree | 90f09ee857d6696f6ea62f6487e730868fcc2008 /bedrock-core.wat | |
parent | 39af042fbcc7cf900493df33f69281a39dee4a51 (diff) | |
download | bedrock-js-8de8a05ffbd622810cc23f6ae818c3bd6cfcf8a0.zip |
Fix draw operations failing at the start of a program
The emulator screen panel is designed to stay hidden until it's needed,
so that headless programs don't have a large black canvas taking up
space on the page. The issue was that the screen content won't be
rendered to the canvas if the screen isn't 'dirty', and the screen will
only be marked dirty if there's been a draw operation in-bounds, and
the size of the canvas determines what counts as in-bounds, and the
size of the canvas remains zero until the layout engine has a chance to
resize it during the next browser render tick. This is all fixed by
breaking the current evaluation loop, yielding control back to the
browser, and having the updateScreenSize function queued up to act on
the newly-resized canvas element. Evaluation will then continue as
normal.
Diffstat (limited to 'bedrock-core.wat')
0 files changed, 0 insertions, 0 deletions