HTML5 Canvas Articles

Page 34 of 49

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

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 415 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 lock the horizontal movement of Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 496 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

How to lock the horizontal scaling of a Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to lock the horizontal 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 scaling an object horizontally. This can be done by using the lockScalingX property. Syntax new fabric.Rect({ lockScalingX : Boolean }) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using ...

Read More

How to lock the horizontal skewing of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to lock the horizontal skewing 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 skewing an object horizontally. This can be done by using the lockSkewingX property. Syntax new fabric.Rect({ lockSkewingX : Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, ...

Read More

How to lock the rotation of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to lock the rotation 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 rotate or not. This can be done by using the lockRotation property. Syntax new fabric.Rect({ lockRotation : Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our ...

Read More

How to set the border scale factor of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to set the border scale factor 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 use the borderScaleFactor property which specifies the scale factor of the object's controlling borders. This property controls the thickness of the selection border that appears when an object is selected on the canvas. Syntax ...

Read More

How to set the minimum allowed scale value of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to set the minimum allowed scale of 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 a rectangle object by adding a fill colour to it, eliminate its borders or even make changes in its dimensions. Similarly, we can also set its minimum allowed scale by using the minScaleLimit property. Syntax new fabric.Rect({ minScaleLimit : Number }: Object) ...

Read More

How to add dashed stroke to a Textbox using FabricJS?

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

In this tutorial, we are going to learn how to add a dashed stroke to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The strokeDashArray property allows us to specify a dash pattern for the object's stroke. Syntax new fabric.Textbox(text: String, { strokeDashArray: Array }: Object) Parameters text − This parameter accepts ...

Read More

How to add stroke to a Textbox using FabricJS?

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

In this tutorial, we are going to learn how to add stroke to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Our textbox object can be customized in various ways like changing its dimensions, adding a background colour, or by changing the colour of the line drawn around the object. We can do this by using the stroke property. Syntax new fabric.Textbox(text: String, { stroke : ...

Read More

How to change the font size of a Textbox using FabricJS?

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

In this tutorial, we are going to see how to change the font size of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The font size specifies how large or small the characters displayed in our textbox should be. We can change the font size by using the fontSize property. Syntax new fabric.Textbox(text: String, { fontSize: Number }: Object) Parameters ...

Read More
Showing 331–340 of 482 articles
« Prev 1 32 33 34 35 36 49 Next »
Advertisements