wrong filter check

This commit is contained in:
Anton Lavrenov
2016-09-11 10:01:38 -04:00
parent 1163baffc0
commit 9d497f2837
3 changed files with 20 additions and 6 deletions

View File

@@ -358,12 +358,19 @@
// apply filters to filter context
for (n = 0; n < len; n++) {
filter = filters[n];
if (typeof filter !== 'function') {
Konva.Util.error(
'Filter should be type of function, but got ' +
(typeof filter) + ' insted. Please check correct filters'
);
continue;
}
filter.call(this, imageData);
filterContext.putImageData(imageData, 0, 0);
}
}
catch(e) {
Konva.Util.warn('Unable to apply filter. ' + e.message);
Konva.Util.error('Unable to apply filter. ' + e.message);
}
this._filterUpToDate = true;