From 9a1d8ee585537189260742734edc7b3bbb4d0358 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sat, 24 Mar 2018 19:28:47 +0100 Subject: [PATCH] done something --- src/canvas.class.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/canvas.class.js b/src/canvas.class.js index 12c848fe49c..8cd60d0bc9d 100644 --- a/src/canvas.class.js +++ b/src/canvas.class.js @@ -377,14 +377,22 @@ this.clearContext(this.contextTop); this.contextTopDirty = false; } - if (this.isDrawingMode && this._isCurrentlyDrawing) { - this.freeDrawingBrush && this.freeDrawingBrush._render(); - } + this.renderTopLayer(this.contextTop); var canvasToDrawOn = this.contextContainer; this.renderCanvas(canvasToDrawOn, this._chooseObjectsToRender()); return this; }, + renderTopLayer: function(ctx) { + if (this.isDrawingMode && this._isCurrentlyDrawing) { + this.freeDrawingBrush && this.freeDrawingBrush._render(); + } + // we render the top context - last object + if (this.selection && this._groupSelector) { + this._drawSelection(ctx); + } + }, + /** * Method to render only the top canvas. * Also used to render the group selection box. @@ -394,12 +402,7 @@ renderTop: function () { var ctx = this.contextTop; this.clearContext(ctx); - - // we render the top context - last object - if (this.selection && this._groupSelector) { - this._drawSelection(ctx); - } - + this.renderTopLayer(ctx); this.fire('after:render'); this.contextTopDirty = true; return this;