fixed up Image hit draw func

This commit is contained in:
Eric Rowell
2012-11-23 23:55:20 -08:00
parent b67cc4b589
commit 7f68dafb5c
4 changed files with 15 additions and 8 deletions

View File

@@ -56,13 +56,19 @@ Kinetic.Image.prototype = {
drawHitFunc: function(context) {
var width = this.getWidth(), height = this.getHeight(), imageBuffer = this.imageBuffer, appliedShadow = false;
if(imageBuffer) {
this.drawImage(context, this.imageBuffer, 0, 0, width, height);
context.beginPath();
context.rect(0, 0, width, height);
context.closePath();
this.stroke(context);
}
else {
context.beginPath();
context.rect(0, 0, width, height);
context.closePath();
this.fillStroke(context);
if(imageBuffer) {
this.drawImage(context, this.imageBuffer, 0, 0, width, height);
}
},
/**

View File

@@ -771,6 +771,7 @@ Test.Modules.NODE = {
cachedShape.createImageBuffer(function() {
console.log(111)
layer.draw();
//console.log(layer.toDataURL());
warn(dataUrls['regular and cahced polygon'] === layer.toDataURL(), 'regular and cached polygon layer data url is incorrect');

View File

@@ -85,7 +85,7 @@ Test.Modules.LINE = {
blur: 10,
offset: [20, 20]
},
opacity: 0.2
//opacity: 0.2
});
layer.add(line);

View File

@@ -392,7 +392,7 @@ Test.Modules.PATH = {
layer.add(group);
stage.add(layer);
//document.body.appendChild(layer.bufferCanvas.element)
showHit(layer);
},
'Able to determine point on line some distance from another point on line': function(containerId) {