mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-25 13:43:44 +00:00
Update renderCursor/renderSelection
Update renderCursor()/renderSelection() to draw to separate canvas
This commit is contained in:
parent
e3dd37ff22
commit
394732f3a3
1 changed files with 7 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue