emscripten-core / emscripten-core/emscripten

When offscreen canvas is used with threads disabled it changes sizes incorrectly

Open
#26,394 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 5.0.2 (dc80f645ee70178c11666de0c3860d9e064d50e4)
clang version 23.0.0git (https:/github.com/llvm/llvm-project 58f4da463e5b3cd3531cace17cc3f2d8d860964e)
Target: wasm32-unknown-emscripten
Thread model: posix

The methods themselves are `emscripten_get_canvas_element_size` and `emscripten_set_canvas_element_size`. After manually including the fix from https://github.com/emscripten-core/emscripten/pull/23518 in the final js it works correctly. More accurately it sets the sizes on the wrong object, if the comment is correct, it sets it on the offscreen canvas record.

Edit: Looked more closely at the code and seems like it actually only an issue if threads are disabled. Honestly offscreen canvas is unlikely to be used without threads, but I'm going to guess it is allowed if there is no errors

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.