jsme-editor / jsme-editor.github.io

73 stars 19 forks source link

after reset called first callback given via setAfterStructureModifiedCallback is broken + some visual glitches #35

Open Nagyjano opened 1 year ago

Nagyjano commented 1 year ago

Hi there!

I think this callback function is not working as I imagine. If you call JSME.reset() and than you draw just one item like a simple bond than it not triggers the callback given with setAfterStructureModifiedCallback, although if you add additional data to your structure than all subsequent action trigger this callback. If I choose to add a chain than it triggers always in my experience. If I call from code the JSME.molFile() than it returns me the drawn structure although my callback was not triggered.

Other note is that after JSME.reset it does not change visually which tool are used but in the background it resets it to default (bond) and you will see the result a little confusing as you think you will place for example a ring but instead it draws a bond.

With the official example page has the same behavior if you use clear tool. Here: https://jsme-editor.github.io/dist/JSME_callback_and_mark.html

Is it a bug or I am using something improperly?