diff --git a/api/tests/integration/ref/rendering/render_reactions.py.out b/api/tests/integration/ref/rendering/render_reactions.py.out index 5fdd2c5b3a..081884917e 100644 --- a/api/tests/integration/ref/rendering/render_reactions.py.out +++ b/api/tests/integration/ref/rendering/render_reactions.py.out @@ -15,3 +15,5 @@ issue 2512 two short equilibrium half arrows issue_2512.png rendering status: OK issue 2513 elliptical-arc-arrow render error issue_2513.png rendering status: OK +issue 2741 missing stereochemistry +missing_stereochemistry_2741.png rendering status: OK diff --git a/api/tests/integration/tests/rendering/reactions/missing_stereochemistry_2741.cdxml b/api/tests/integration/tests/rendering/reactions/missing_stereochemistry_2741.cdxml new file mode 100644 index 0000000000..1015022a1a --- /dev/null +++ b/api/tests/integration/tests/rendering/reactions/missing_stereochemistry_2741.cdxml @@ -0,0 +1,356 @@ + + + + + + + + + + + + + +NCNNHNCN \ No newline at end of file diff --git a/api/tests/integration/tests/rendering/ref/linux/missing_stereochemistry_2741.png b/api/tests/integration/tests/rendering/ref/linux/missing_stereochemistry_2741.png new file mode 100644 index 0000000000..0b6932481d Binary files /dev/null and b/api/tests/integration/tests/rendering/ref/linux/missing_stereochemistry_2741.png differ diff --git a/api/tests/integration/tests/rendering/ref/mac/missing_stereochemistry_2741.png b/api/tests/integration/tests/rendering/ref/mac/missing_stereochemistry_2741.png new file mode 100644 index 0000000000..0b6932481d Binary files /dev/null and b/api/tests/integration/tests/rendering/ref/mac/missing_stereochemistry_2741.png differ diff --git a/api/tests/integration/tests/rendering/ref/win/missing_stereochemistry_2741.png b/api/tests/integration/tests/rendering/ref/win/missing_stereochemistry_2741.png new file mode 100644 index 0000000000..0b6932481d Binary files /dev/null and b/api/tests/integration/tests/rendering/ref/win/missing_stereochemistry_2741.png differ diff --git a/api/tests/integration/tests/rendering/render_reactions.py b/api/tests/integration/tests/rendering/render_reactions.py index 954bcc6ccc..848abc9bcc 100644 --- a/api/tests/integration/tests/rendering/render_reactions.py +++ b/api/tests/integration/tests/rendering/render_reactions.py @@ -117,6 +117,16 @@ def renderRxnfile(filename, outfile): renderer.renderToFile(rxn, joinPathPy("out/" + png_fname, __file__)) print(checkImageSimilarity(png_fname)) +print("issue 2741 missing stereochemistry") +indigo.resetOptions() +indigo.setOption("render-output-format", "png") +fname = "missing_stereochemistry_2741" +png_fname = fname + ".png" +cdxml_fname = joinPathPy("reactions/%s.cdxml" % fname, __file__) +rxn = indigo.loadReactionFromFile(cdxml_fname) +renderer.renderToFile(rxn, joinPathPy("out/" + png_fname, __file__)) +print(checkImageSimilarity(png_fname)) + if isIronPython(): renderer.Dispose() indigo.Dispose() diff --git a/core/render2d/src/render_internal.cpp b/core/render2d/src/render_internal.cpp index 1a3a7cc661..2655125171 100644 --- a/core/render2d/src/render_internal.cpp +++ b/core/render2d/src/render_internal.cpp @@ -874,8 +874,9 @@ void MoleculeRenderInternal::_prepareSGroups(bool collapseAtLeastOneSuperatom) else { Molecule& amol = mol.asMolecule(); - bondID = amol.addBond(superAtomID, neighboringAtomID, amol.getBondOrder(neighboringBondID)); + bondID = amol.addBond(neighboringAtomID, superAtomID, amol.getBondOrder(neighboringBondID)); amol.setEdgeTopology(bondID, amol.getBondTopology(neighboringBondID)); + amol.setBondDirection(bondID, mol.getBondDirection(neighboringBondID)); } if (_bondMappingInv.find(bondID) != _bondMappingInv.end()) _bondMappingInv.erase(bondID);