Fix globalCompositeOperation + cached hit detections. close #759

This commit is contained in:
Anton Lavrenov
2019-10-10 15:52:00 -05:00
parent 7909283e3d
commit 80c674eb1f
8 changed files with 78 additions and 20 deletions

View File

@@ -419,7 +419,9 @@ export abstract class Container<ChildType extends Node> extends Node<
}
var hasComposition =
this.globalCompositeOperation() !== 'source-over' && !skipComposition;
this.globalCompositeOperation() !== 'source-over' &&
!skipComposition &&
drawMethod === 'drawScene';
if (hasComposition && layer) {
context.save();
context._applyGlobalCompositeOperation(this);

View File

@@ -575,7 +575,6 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
var canvasCache = this._getCanvasCache(),
hitCanvas = canvasCache.hit;
context.save();
context._applyGlobalCompositeOperation(this);
context.translate(canvasCache.x, canvasCache.y);
context.drawImage(hitCanvas._canvas, 0, 0);
context.restore();

View File

@@ -50,7 +50,7 @@ function _strokeFunc(context) {
* ' ': -0.05517578125,
* 'T': -0.07421875,
* 'V': -0.07421875
* }
* }
* 'V': {
* ',': -0.091796875,
* ":": -0.037109375,