我希望用户能够选择fabric.Textbox并进行旋转,移动,调整大小等但不能编辑文本。要编辑文本,用户必须选择文本框对象,然后激活短信(不在结构中)。 所以我想要的是避免用户可以编辑结构中的文本(如fabric.Text)。 有没有办法做到这一点?
答案 0 :(得分:6)
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>
&#13;
fabricjs Textbox子类itext。 从iText文档中可以看到:
/**
* Indicates whether a text can be edited
* @type Boolean
* @default
*/
editable: true,
为什么te游标仍然出现对我来说是个谜。所以我应用了cursorWidth = 0来临时修补问题。 可能是图书馆本身的一个问题。
答案 1 :(得分:3)
SELECT '1' as EntityID, '2018-01-01' as deployed, 'app' as type FROM DUAL UNION ALL
SELECT '2' as EntityID, '2018-02-02' as deployed, 'app' as type FROM DUAL