added logic to correctly draw buffer paths for cases where a developer is creating an invisible mask for event detections

This commit is contained in:
Eric Rowell
2012-08-20 22:11:13 -07:00
parent 92208d8e56
commit 15aeabacc1
5 changed files with 12 additions and 12 deletions

10
dist/kinetic-core.js vendored
View File

@@ -2205,8 +2205,8 @@ Kinetic.Node = Kinetic.Class.extend({
},
_draw: function(canvas) {
if(this.isVisible() && (!canvas || canvas.name !== 'buffer' || this.getListening())) {
if(this._beforeDraw) {
this._beforeDraw(canvas);
if(this.__draw) {
this.__draw(canvas);
}
var children = this.children;
@@ -3674,7 +3674,7 @@ Kinetic.Layer = Kinetic.Container.extend({
}
return canvas.toDataURL(mimeType, quality);
},
_beforeDraw: function(canvas) {
__draw: function(canvas) {
if(this.attrs.clearBeforeDraw) {
canvas.clear();
}
@@ -4072,7 +4072,7 @@ Kinetic.Shape = Kinetic.Node.extend({
var obj = stage.getIntersection(pos);
return !!(obj && obj.pixel[3] > 0);
},
_beforeDraw: function(canvas) {
__draw: function(canvas) {
if(this.attrs.drawFunc) {
var stage = this.getStage();
var context = canvas.getContext();
@@ -4113,7 +4113,7 @@ Kinetic.Shape = Kinetic.Node.extend({
for(var n = 0; n < wl.length; n++) {
var key = wl[n];
attrs[key] = this.attrs[key];
if(this.attrs[key]) {
if(this.attrs[key] || (key === 'fill' && !this.attrs.stroke)) {
this.attrs[key] = '#' + this.colorKey;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -166,7 +166,7 @@ Kinetic.Layer = Kinetic.Container.extend({
}
return canvas.toDataURL(mimeType, quality);
},
_beforeDraw: function(canvas) {
__draw: function(canvas) {
if(this.attrs.clearBeforeDraw) {
canvas.clear();
}

View File

@@ -985,8 +985,8 @@ Kinetic.Node = Kinetic.Class.extend({
},
_draw: function(canvas) {
if(this.isVisible() && (!canvas || canvas.name !== 'buffer' || this.getListening())) {
if(this._beforeDraw) {
this._beforeDraw(canvas);
if(this.__draw) {
this.__draw(canvas);
}
var children = this.children;

View File

@@ -331,7 +331,7 @@ Kinetic.Shape = Kinetic.Node.extend({
var obj = stage.getIntersection(pos);
return !!(obj && obj.pixel[3] > 0);
},
_beforeDraw: function(canvas) {
__draw: function(canvas) {
if(this.attrs.drawFunc) {
var stage = this.getStage();
var context = canvas.getContext();
@@ -372,7 +372,7 @@ Kinetic.Shape = Kinetic.Node.extend({
for(var n = 0; n < wl.length; n++) {
var key = wl[n];
attrs[key] = this.attrs[key];
if(this.attrs[key]) {
if(this.attrs[key] || (key === 'fill' && !this.attrs.stroke)) {
this.attrs[key] = '#' + this.colorKey;
}
}