reymond-group / smilesDrawer

A small, highly performant JavaScript component for parsing and drawing SMILES strings. Released under the MIT license.
https://smilesdrawer.rocks
MIT License
437 stars 70 forks source link

Invisible horizontal bond in svg of two-atom SMILES #177

Open Acylation opened 1 year ago

Acylation commented 1 year ago

Sample smiles: CC and CO

image

Proposed changes:

Setting 'maskUnits' attribute of the mask elements to 'userSpaceOnUse'

image

Keyword objectBoundingBox should not be used when the geometry of the applicable element has no width or no height, such as the case of a horizontal or vertical line, even when the line has actual thickness when viewed due to having a non-zero stroke width since stroke width is ignored for bounding box calculations. When the geometry of the applicable element has no width or height and objectBoundingBox is specified, then the given effect (e.g., a gradient or a filter) will be ignored.

https://bugs.chromium.org/p/chromium/issues/detail?id=570432 https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/maskUnits