Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 44 of 49

How to flip a Rectangle vertically using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 316 Views

In this tutorial, we are going to learn how we can flip a Rectangle object vertically using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. We can flip a rectangle object vertically using the flipY property. Syntax new fabric.Rect({ flipY: Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our ...

Read More

FabricJS – How to set a multiplier to scale by in the URL string of a Line object?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 513 Views

In this tutorial, we are going to learn about how to set a multiplier to scale by in the URL string of Line object using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to set a multiplier to scale by in the URL ...

Read More

How to hide the controlling borders of a Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 639 Views

In this tutorial, we are going to learn how to hide the controlling borders of a Rectangle using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. We can customize our controlling borders in many ways such as adding a specific colour to it, a dash pattern, etc. However, we can also eliminate the borders completely by using the hasBorders property. Syntax new fabric.Rect({ hasBorders: Boolean }: Object) Parameters ...

Read More

FabricJS – How to set the position of a Line object with respect to origin?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we are going to learn about how to set position of Line object with respect to origin using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to set the position of Line object with respect to origin we use the ...

Read More

How to hide the controlling corners of a Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 322 Views

In this tutorial, we are going to learn how to hide the controlling corners of a Rectangle using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. The controlling corners of an object allow us to increase or decrease its scale, stretch or change its position. We can customize our controlling corners in many ways such as adding a specific colour to it, changing their size, ...

Read More

How to set the size of subscript with Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 319 Views

In this tutorial, we are going to learn how to set the size of subscript with Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also use the subscript property where we can specify its size. Syntax new fabric.Text(text: String , { subscript : {"size": Number, "baseline": Number}: ...

Read More

How to set the angle of a Line in FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 352 Views

In this tutorial, we are going to learn about how to set the angle of a Line object using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to set the angle of a line object we use the angle property. Syntax ...

Read More

How to lock the flipping during scaling of Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 402 Views

In this tutorial, we are going to learn how to lock the flipping during scaling of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want to stop flipping an object during scaling. This can be done by using the lockScalingFlip property. Syntax new fabric.Rect({ lockScalingFlip : Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, ...

Read More

How to set the size of superscript with Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 223 Views

In this tutorial, we are going to learn how to set the size of superscript with Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also use the superscript property where we can specify its size. Syntax new fabric.Text(text: String , { superscript : {"size": Number, "baseline": Number}: ...

Read More

How to lock the horizontal movement of Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 484 Views

In this tutorial, we are going to learn how to lock the horizontal movement of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want it to move only in the Y-axis. This can be done by using the lockMovementX property. Syntax new fabric.Rect({ lockMovementX: Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations ...

Read More
Showing 431–440 of 490 articles
« Prev 1 42 43 44 45 46 49 Next »
Advertisements