summaryrefslogtreecommitdiff
path: root/bedrock-core.wat
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-09-13 07:20:51 +1200
committerBen Bridle <ben@derelict.engineering>2025-09-13 07:50:11 +1200
commit8de8a05ffbd622810cc23f6ae818c3bd6cfcf8a0 (patch)
tree90f09ee857d6696f6ea62f6487e730868fcc2008 /bedrock-core.wat
parent39af042fbcc7cf900493df33f69281a39dee4a51 (diff)
downloadbedrock-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