Update renderCursor/renderSelection

Update renderCursor()/renderSelection() to draw to separate canvas
This commit is contained in:
GordoRank 2014-01-20 14:54:41 +00:00
parent e3dd37ff22
commit 394732f3a3

View file

@ -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),