Fix ImageData Constructor Support Detection
Our support detection for the `ImageData(data, width, height)` constructor would fail in certain browsers because the size of a 1x1 ImageData's Uint8ClampedArray is 4, not 1.
This commit is contained in:
parent
aef8731666
commit
e93807ade2
|
@ -17,7 +17,7 @@ var Display;
|
||||||
|
|
||||||
var SUPPORTS_IMAGEDATA_CONSTRUCTOR = false;
|
var SUPPORTS_IMAGEDATA_CONSTRUCTOR = false;
|
||||||
try {
|
try {
|
||||||
new ImageData(new Uint8ClampedArray(1), 1, 1);
|
new ImageData(new Uint8ClampedArray(4), 1, 1);
|
||||||
SUPPORTS_IMAGEDATA_CONSTRUCTOR = true;
|
SUPPORTS_IMAGEDATA_CONSTRUCTOR = true;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// ignore failure
|
// ignore failure
|
||||||
|
|
Loading…
Reference in New Issue