I changed the value of centerX and CenterY to center, and it got great. Updated code should look like this. Your updated code is http://jsbin.com/nepiqaviqe/1/edit?js,output
var triangle = new fabric.Triangle({
angle: angle,
fill: '#207cca',
top: y2,
left: x2,
height: headLength,
width: headLength,
originX: 'center',
originY: 'center',
selectable: false
});
fCanvas.add(triangle);
}
function createLineArrow(points) {
var line = new fabric.Line(points, {
strokeWidth: 5,
stroke: '#7db9e8',
originX: 'center',
originY: 'center',
hasControls: false,
hasBorders: false,
hasRotatingPoint: false,
hoverCursor: 'default',
selectable: false
});
source
share