mirror of
https://github.com/konvajs/konva.git
synced 2026-01-18 19:51:21 +08:00
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:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
filterCanvas = this.filterCanvas = new Kinetic.SceneCanvas({
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
|
||||
context = filterCanvas.getContext();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user