federico-moretti / canvas-free-drawing

A JavaScript library that allows you to draw in a canvas HTML element, straightforward to use and extremely lightweight.
https://www.federicomoretti.dev/projects/canvas-free-drawing
MIT License
65 stars 11 forks source link

how can i fix CanvasFreeDrawing is not a constructor #5

Closed manoyna closed 5 years ago

manoyna commented 5 years ago

hi i run the example file and have this error CanvasFreeDrawing is not a constructor. how can i fix it thank you.

federico-moretti commented 5 years ago

Ok, I've been able to reproduce it, I'm gonna fix it soon! In the meantime you can use the module version that is working fine.

federico-moretti commented 5 years ago

I've found that you could make it work just changing the class init to new CanvasFreeDrawing.default().

I'll update the example file to reflect the change, thank you for the bug report!