In this article, we are going to see how to remove only the rotation controls of a canvas-like text using FabricJS. The canvas means text written is movable and can be stretched according to requirement but we will remove the rotation controls so that it cannot be rotated but only be moved and resized. Further, the text itself cannot be edited like a textbox.
fabric.Text(text, hasRotatingPoint: boolean);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text to be written.
- hasRotatingPoint: It specifies whether to enable or disable the rotation controls, enabled by default.
Program: We can use FabricJS to remove only the rotation controls of canvas-like text as given below. Note that you have to click on the text to see if its controls are there or not.