2015-10-19 21 views

回答

4

canvas = new fabric.Canvas('canvas'); 
 
var shape = new fabric.Textbox('i m an not editable textbox', {width: 200, top:0, left:0, editable: false, cursorWidth: 0}); 
 
canvas.add(shape);
<script src="http://www.deltalink.it/andreab/fabric/fabric.js"></script> 
 
<canvas id='canvas' width="500" height="400" style="border:#000 1px solid;"></canvas>

fabricjs文本框的子类的iText。 从iText的文档,你可以看到:

/** 
* Indicates whether a text can be edited 
* @type Boolean 
* @default 
*/ 
editable: true, 

为什么TE光标似乎仍然是一个谜给我。所以我应用cursorWidth = 0来临时修补问题。 可能是图书馆本身的一个问题。

相关问题