PistoiaHELM / HELMWebEditor

Web browser based editor for drawing HELM macromolecules.
MIT License
19 stars 10 forks source link

Monomer positioning issue #116

Closed MarkusWeisser closed 6 years ago

MarkusWeisser commented 7 years ago

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); };

scilligence commented 7 years ago

Could you have a screenshot here, so we can better understand the issue?

MarkusWeisser commented 6 years ago

Developers are currently not able to reproduce the issue. Can be closed.