From 5753af88bfe3644730ae6800aee5124a38445aeb Mon Sep 17 00:00:00 2001 From: VladimirTechMan Date: Sat, 9 Feb 2019 19:49:22 +0300 Subject: [PATCH 1/2] Setting DD.node to null instead of deleting In the footsteps of my previous commit. This one replaces the deletion of DD.node with setting it to null. --- src/DragAndDrop.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DragAndDrop.ts b/src/DragAndDrop.ts index c3955a39..52d9eaa9 100644 --- a/src/DragAndDrop.ts +++ b/src/DragAndDrop.ts @@ -93,7 +93,7 @@ export const DD = { } } - delete DD.node; + DD.node = null; if (layer || node instanceof getGlobalKonva().Stage) { (layer || node).draw(); From 7cd4905ce509029145aeead765ea3c96364ebe9c Mon Sep 17 00:00:00 2001 From: VladimirTechMan Date: Sat, 9 Feb 2019 22:22:19 +0300 Subject: [PATCH 2/2] Minor corrections to the existing code Removing one redundant variable and one small typo in a comment. --- src/Context.ts | 3 +-- src/Node.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Context.ts b/src/Context.ts index 9edbc2fe..f71a6e51 100644 --- a/src/Context.ts +++ b/src/Context.ts @@ -141,8 +141,7 @@ export class Context { * @param {Konva.Shape} shape */ fillStrokeShape(shape) { - var fillEnabled = shape.getFillEnabled(); - if (fillEnabled) { + if (shape.getFillEnabled()) { this._fill(shape); } if (shape.getStrokeEnabled()) { diff --git a/src/Node.ts b/src/Node.ts index 5a22cb1a..ca53d1a8 100644 --- a/src/Node.ts +++ b/src/Node.ts @@ -182,7 +182,7 @@ export abstract class Node { _clearSelfAndDescendantCache(attr?) { this._clearCache(attr); - // skip clearing of node is cached with canvas + // skip clearing if node is cached with canvas if (this._cache.canvas) { return; }