如何在 Fabric .js 中移除对象周围的蓝色边框

How to remove blue border around objects in Fabric.js

本文关键字:周围 对象 蓝色 边框 Fabric js      更新时间:2023-09-26

我想在画布中心绘制一组对象。但是当我使用addWithUpdate方法时 - 所有对象都有蓝色边框。但是,如果尝试使用add组的方法 - 蓝色边框消失了,但我不知道在这种情况下如何将组移动到中心。

http://jsfiddle.net/DR/格里克兹克/

你去吧

小提琴 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);