Closed OndrejSpanel closed 9 months ago
Hmm. I don't think those are interchangeable. Seems like a bug to me.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray
I guess the interface of both JS types is similar enough, they both contain length
and bracket access, therefore one can perform some basic operations on TypedArray
thinking it is a normal array.
The ImageData.data is defined and documented as follows:
https://github.com/scala-js/scala-js-dom/blob/7d0508cac24b4f2657c3525797fe633feb4849bc/dom/src/main/scala/org/scalajs/dom/ImageData.scala#L23-L26
I am confused: is the type
Uint8ClampedArray
, orjs.Array[Int]
? Or are those types interchangeable somehow? If they are, perhaps the documentation could clarify how.