Reputation: 377
I am doing a project using fabric.js in that I want to display the shape dimensions in canvas and the dimension should change according to drag,drop and resize. Here is the image. Edit: I have to display the dimensions(height,width and angle) for non group shape and group shape using onclick listener.I need help regarding in this any help or hint would be great. Thanks in advance.
Upvotes: 3
Views: 263
Reputation: 945
You can listen to object:scaling events and update the text objectc accordingly, getting the width and height using the functions that @kangax said. You will also need reposition the texts when you resize the object.
Check this link: http://fabricjs.com/events/
Upvotes: 2