Skip to content

Commit 43420c1

Browse files
author
David Gillen
committed
Fix for IE11
1 parent 23b8caf commit 43420c1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/easeljs/filters/DisplacementFilter.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,15 @@ this.createjs = this.createjs||{};
148148
// private methods:
149149
/** docced in super class **/
150150
p._applyFilter = function(imageData) {
151-
var refArray = imageData.data.slice(); // as we're reaching across pixels we need an unmodified clone of the source
151+
// as we're reaching across pixels we need an unmodified clone of the source
152+
// slice/from/map/filter don't work correctly in IE11 and subarray creates a ref
153+
var refArray, refArraySrc = imageData.data;
154+
if (refArraySrc.slice !== undefined) {
155+
refArray = refArraySrc.slice();
156+
} else {
157+
refArray = new Uint8ClampedArray(refArraySrc.length);
158+
refArray.set(refArraySrc);
159+
}
152160

153161
var outArray = imageData.data;
154162
var width = imageData.width;

0 commit comments

Comments
 (0)