Closed iabhishekraj1 closed 3 years ago
I might be reading this wrong... but you have an arrow function inside the change event function... but there is nothing running the arrow function. Maybe do a console.log() to make sure the code you are expecting to run... is running.
I might be reading this wrong... but you have an arrow function inside the change event function... but there is nothing running the arrow function. Maybe do a console.log() to make sure the code you are expecting to run... is running.
@danzen, I have updated the code. I am running a loop on an array of textFields which are selected and then apply selected textAlign on that.
I don't think .getBounds() works well with textFields.
If it were me, I'd work out the bounds manually using the x/y position of the field and getMetrics() to get width and height.
You'd have to work it out a different way according to the alignment.
@iabhishekraj - hope this all got solved... you are always welcome to take a look at the ZIM Label code https://zimjs.com/docs.html?item=Label - in the end, I think we worked everything out with respect to bounds, alignment and hitAreas.
I created an application using create.js where the user can add a text on canvas dynamically.
A user has options to change the alignment of the text which is already added on canvas.
On alignment change, an event fired which executes below code.
Alignment changed successfully but this code is not able to update the hitArea of the text.
What will be the solution for this?