javascriptangularfabricjsfabricjs2

FabricJS: Issue in the selection of shapes angular 6


Currently, I'm working on fabricjs where I'm drawing a different shape. When I do so the shapes are drawn perfectly fine but when I switch to selection mode I'm not able to select the shape. But, when I draw a lot of shapes and select them all together, I'm able to select all of them and later I'm able to individually select shapes which weren't happening before.

my code: https://stackblitz.com/edit/angular-a5tghd

the code that I referred to in order to make this progress

reference code: Fabric js : fabric js drawing mode and selection mode options

thanks :)


Solution

  • After you press on hand option you need to parse all the objects from canvas and call setCoordsfunction enter image description here