In this article, we are going to see how to set the borderScaleFactor of a Path using Fabric.js. The Path in Fabric.js is movable and can be stretched according to requirements. Further, the Path can be customized when it comes to initial stroke color, height, width, fill color, or stroke width.

To make it possible we are going to use a JavaScript HTML5 canvas library called Fabric.js. After importing the library, we will create a canvas block in the body tag that will contain the Path. After this, we will initialize instances of Canvas and Path provided by Fabric.js and enable the border scaling of the canvas Path using borderScaleFactor property.

Syntax:

fabric.Path('path', {
   borderScaleFactor: Number;
});

#javascript #fabric.js

Fabric.js Path borderScaleFactor Property
1.90 GEEK