draw cache hit only when the shape was listening and visible

This commit is contained in:
kzhdev
2014-01-21 16:24:36 -06:00
parent 5fac5b5cb3
commit a3cebbb147
3 changed files with 5 additions and 4 deletions

View File

@@ -594,9 +594,10 @@
* @memberof Kinetic.Node.prototype
* @returns {Boolean}
*/
shouldDrawHit: function() {
shouldDrawHit: function(canvas) {
var layer = this.getLayer();
return layer && layer.hitGraphEnabled() && this.isListening() && this.isVisible() && !Kinetic.isDragging();
return ((canvas && canvas.isCache) || (layer && layer.hitGraphEnabled()))
&& this.isListening() && this.isVisible() && !Kinetic.isDragging();
},
/**
* show node