partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
247 stars 61 forks source link

Geometery Changes when going from Composer to chemObjSetter #316

Open cleblond opened 5 months ago

cleblond commented 5 months ago

HI,

When using the ckeditor plugin, if I create a structure in the composer and click OK the structure is transferred to the chemObjSetter. When it is transferred the geometry is changed (cleaned up). Is it possible to have the geometry remain as I've drawn it? See attached screenshots.

chemObjSetter composer_after

partridgejiang commented 4 months ago

Sorry that I have missed this message for so long... Actually, it merely caused by the different default zoom ratios in editor and viewer widget. In editor, the initial zoom level is 1.5 times larger than the viewer to make the input of structures more easily (especially in mobile devices). You may change the default zoom value of the viewer by:

chemObjInserter.viewer.initialZoom = 1.5;