rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript

Home Page:https://rustwasm.github.io/docs/wasm-bindgen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`gen_UiEvent.rs`: `page_x` and `page_y` should return `f64` instead of `i32`

lpotthast opened this issue · comments

Describe the Bug

The page_x and page_y functions from gen_UiEvent.rs provide i32 values.

But the MDN page (MouseEvent) states that these should both be:

A floating-point number of pixels from the left edge of the document at which the mouse was clicked, [...]
This property was originally specified in the Touch Events specification as a long integer, but was redefined in the CSSOM View Module to be a double-precision floating-point number to allow for subpixel precision.

Expected Behavior

The functions to return f64, conforming to the double-precision floating-point number statement.
If the browser wouldn't support subpixel precision, full integers would still be represented.

This is a duplicate of #2079.

TLDR: This is a known bug, but requires a breaking change to fix.

This is a duplicate of #3871.

I think you meant #2079, but yes.