【发布时间】:2016-10-03 01:51:51
【问题描述】:
我想知道,是否可以使用fabric js在画布中隐藏文本对象?
我不想删除对象,因为我需要进一步使用它,所以只想隐藏它。我搜索了很多,但没有任何工作。
这是我的fabric js代码。
var text = new fabric.Text("test", {
fontFamily: 'Times new roman',
fontSize: fabric.util.parseUnit(fontSize),
left: (startPosition.x + pointer.x) / 2,
top: ((startPosition.y + pointer.y) / 2) + 10,
slope: ((startPosition.y - pointer.y) / (startPosition.x - pointer.x)),
originX: 'center',
originY: 'center',
});
canvas.add(text);
//canvas.getObjects(text).style.display = "none";
//text.prop.hide();
//text.hide = function () {
//text.set({
// css: {"display":"none"},
// selectable: false
// });
//};
所有建议都是例外。
【问题讨论】:
标签: javascript asp.net-mvc canvas html5-canvas html2canvas