better error messages

This commit is contained in:
Anton Lavrenov 2020-02-25 19:22:46 -05:00
parent 2e40322b83
commit c6e38c55a1
3 changed files with 17 additions and 6 deletions

View File

@ -5,8 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Not released:
## 4.1.6 - 2020-02-25
* Events fixes for `Konva.Transformer`
* Now `Konva` will keep `id` in a cloned node
* Better error messages on tainted canvas issues
## 4.1.5 - 2020-02-16

View File

@ -135,7 +135,11 @@ export class Canvas {
try {
return this._canvas.toDataURL();
} catch (err) {
Util.error('Unable to get data URL. ' + err.message);
Util.error(
'Unable to get data URL. ' +
err.message +
'. For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.'
);
return '';
}
}

View File

@ -619,7 +619,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
Util.error(
'Filter should be type of function, but got ' +
typeof filter +
' insted. Please check correct filters'
' instead. Please check correct filters'
);
continue;
}
@ -627,7 +627,11 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
filterContext.putImageData(imageData, 0, 0);
}
} catch (e) {
Util.error('Unable to apply filter. ' + e.message);
Util.error(
'Unable to apply filter. ' +
e.message +
'. This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.'
);
}
this._filterUpToDate = true;
@ -2233,9 +2237,9 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
var stopBubble =
(eventType === MOUSEENTER || eventType === MOUSELEAVE) &&
compareShape &&
compareShape.isAncestorOf &&
compareShape.isAncestorOf(this) &&
!compareShape.isAncestorOf(this.parent);
compareShape.isAncestorOf &&
compareShape.isAncestorOf(this) &&
!compareShape.isAncestorOf(this.parent);
if (
((evt && !evt.cancelBubble) || !evt) &&
this.parent &&