0
我想在畫布中心繪製一組對象。但是當我使用addWithUpdate
方法時 - 組中的所有對象都有藍色邊框。但是如果嘗試使用add
組的方法 - 藍色邊框消失了,但我不知道在這種情況下如何移動組居中。如何在Fabric.js中刪除對象周圍的藍色邊框
http://jsfiddle.net/DR/hrykgzks/
我想在畫布中心繪製一組對象。但是當我使用addWithUpdate
方法時 - 組中的所有對象都有藍色邊框。但是如果嘗試使用add
組的方法 - 藍色邊框消失了,但我不知道在這種情況下如何移動組居中。如何在Fabric.js中刪除對象周圍的藍色邊框
http://jsfiddle.net/DR/hrykgzks/
在這裏你去
小提琴http://jsfiddle.net/hrykgzks/1/
JS
canvas = new fabric.StaticCanvas(document.getElementById("schemaCanvas"));
group = new fabric.Group();
side_a = new fabric.Line([0, 0, 200, 0], {
stroke: "black",
strokeWidth: 10,
hasBorders: false
});
group.addWithUpdate(side_a);
side_b = new fabric.Line([200, 0, 200, 200], {
stroke: "black",
strokeWidth: 10,
hasBorders: false
});
group.addWithUpdate(side_b);
canvas.centerObject(group);
canvas.add(group);