From 394732f3a3aa62b1d06075255fbd18721b9a392e Mon Sep 17 00:00:00 2001 From: GordoRank Date: Mon, 20 Jan 2014 14:54:41 +0000 Subject: [PATCH] Update renderCursor/renderSelection Update renderCursor()/renderSelection() to draw to separate canvas --- src/shapes/itext.class.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index 521a4f3a..4600ed14 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -464,9 +464,12 @@ * @param {Object} boundaries */ renderCursor: function(boundaries) { - var ctx = this.ctx; + if(!this.contextSelection) return; + var ctx = this.contextSelection; ctx.save(); + + this.transform(ctx); var cursorLocation = this.get2DCursorLocation(), lineIndex = cursorLocation.lineIndex, @@ -494,11 +497,13 @@ * @param {Object} boundaries Object with left/top/leftOffset/topOffset */ renderSelection: function(chars, boundaries) { - var ctx = this.ctx; + if(!this.contextSelection) return; + var ctx = this.contextSelection; ctx.save(); ctx.fillStyle = this.selectionColor; + this.transform(ctx); var start = this.get2DCursorLocation(this.selectionStart), end = this.get2DCursorLocation(this.selectionEnd),