Fixed Issue #462

When image filters were being applied they were cached or buffered in
`filterCanvas`. It seemed like image would be drawn multiple times (ie
calling `layer.draw()` would cause the `drawFunc` to run about 2 to 4 times).
Each time it ran it would draw on top of the cached `filterCanvas`. The
non-zero alpha values accumulated until they reached 255, effectively
removing the alpha-channel.

To fix it, I create a new `filterCanvas` everytime. I don't check for or
use the previous `filterCanvas`. I haven't notice other issues by removing
it.
This commit is contained in:
ippo615
2013-08-23 21:55:11 -04:00
parent dd306dc7fd
commit 3e2024b3f3

View File

@@ -118,15 +118,11 @@
filter = this.getFilter(),
filterCanvas, context, imageData;
if (this.filterCanvas){
filterCanvas = this.filterCanvas;
}
else {
filterCanvas = this.filterCanvas = new Kinetic.SceneCanvas({
width: width,
height: height
});
}
context = filterCanvas.getContext();