Search code examples
canvasfabricjs

touchCornerSize does not exist in type 'IPolylineOptions'


I build an Angular App and I want to use touchCornerSize.

I have run npm run build_with_gestures successfully but when I add the property to a Polygon, I get

touchCornerSize does not exist in type 'IPolylineOptions'.

After installing the custom library, I have restarted the app and the editor.


Solution

  • The answer is simple.

    The properties shown in the Docs are not options, but class variables.

    This means that touchCornerSize is not added as an option when the object is initialized, but as a direct variable. E.g

    this.polygon.touchCornerSize = 20;