DrawerJs
DrawerJs copied to clipboard
Continue using the last tool.
I have a canvas that requires, the person to draw a rectangle multiple times. Each time the person has to re-select the Rectangle Shape from the toolbar. Is there a way to keep using the Rectangle tool after creating a single instance ?
For default config, I have this
defaultActivePlugin: {
name: 'Rectangle',
mode: 'lastUsed'
}
but this is for init
only.
As far as I can tell using the API / Configuration options: No
Using the Code: Partially I tried adding this (the code for deactivating the tool is here: https://github.com/carstenschaefer/DrawerJs/blob/8dd40abe890901e906792e8a104fddbe8c0be8c9/src/plugins/BaseShape.js#L211) but just ignoring the deactivating gives error messages. So you will probably need to deactivate the tool and then reactivate it. But I did not test this assumption.