During embedding of the editor in a custom application, we observed a positioning issue when the browser page has a scrollbar. A scrollbar can be forced by displaying developer tool in the browser page.
In this case, selecting a monomer and clicking on the canvas will not position the monomer at the exact mouse position anymore.
scilligence.Utils.getOffset method seems to be problematic. The offset calculated for an element is incorrect.
This issue can be fixed by changing to code to
scilligence.Utils.getOffset = function(e, a) { return new JSDraw2.Point(e.getBoundingClientRect().left, e.getBoundingClientRect().top); };
During embedding of the editor in a custom application, we observed a positioning issue when the browser page has a scrollbar. A scrollbar can be forced by displaying developer tool in the browser page. In this case, selecting a monomer and clicking on the canvas will not position the monomer at the exact mouse position anymore. scilligence.Utils.getOffset method seems to be problematic. The offset calculated for an element is incorrect. This issue can be fixed by changing to code to
scilligence.Utils.getOffset = function(e, a) { return new JSDraw2.Point(e.getBoundingClientRect().left, e.getBoundingClientRect().top); };