Skip to content

--cfg=web_sys_unstable_apis changes position APIs in web_sys to use f64 instead of i32#449

Open
Jazzpirate wants to merge 2 commits intothaw-ui:mainfrom
Jazzpirate:main
Open

--cfg=web_sys_unstable_apis changes position APIs in web_sys to use f64 instead of i32#449
Jazzpirate wants to merge 2 commits intothaw-ui:mainfrom
Jazzpirate:main

Conversation

@Jazzpirate
Copy link
Copy Markdown
Contributor

if web_sys_unstable_apis is active, several methods in web_sys use f64 instead of i32 (e.g. scroll offsets, mouse positions), which breaks several methods in thaw. To fix this, I added an exported macro to thaw_utils to be as uninvasive as possible, that converts f64 to i32 or vice versa iff web_sys_unstable_apis is active and wrap that around the offending function calls.

To verify that the previous version breaks and this one works, run RUSTFLAGS="--cfg=web_sys_unstable_apis" trunk build in demo.

@Jazzpirate
Copy link
Copy Markdown
Contributor Author

Note:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant