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;