You can try using the LEFT and TOP.
For example, locating can be done this way. This could be an example for you.
var circle = new fabric.Circle({
left: 20,
top: 15,
radius: 25,
fill: randomColor(),
hasRotatingPoint: true
});
canvas.add(circle)
If you want it to be random, you can use it as follows.
var circle = new fabric.Circle({
left: fabric.util.getRandomInt(25, canvas.width - 25),
top: fabric.util.getRandomInt(25, canvas.height - 25),
radius: 25,
fill: randomColor(),
hasRotatingPoint: true
});
canvas.add(circle);
Hopefully it benefits your business.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…