Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MolDraw2DQt and MolDraw2DJS don't draw wavy bonds #5386

Closed
greglandrum opened this issue Jun 24, 2022 · 0 comments
Closed

MolDraw2DQt and MolDraw2DJS don't draw wavy bonds #5386

greglandrum opened this issue Jun 24, 2022 · 0 comments
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Describe the bug
Wavy bonds are ignored by MolDraw2DQt

To Reproduce

  {
    auto mol = "CC=CC"_smiles;
    REQUIRE(mol);
    mol->getBondWithIdx(1)->setStereoAtoms(0, 3);
    mol->getBondWithIdx(1)->setStereo(Bond::BondStereo::STEREOANY);
    bool kekulize = true;
    bool addChiralHs = true;
    bool wedgeBonds = true;
    bool forceCoords = true;
    bool wavyBonds = true;
    MolDraw2DUtils::prepareMolForDrawing(*mol, kekulize, addChiralHs,
                                         wedgeBonds, forceCoords, wavyBonds);
    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::BondDir::UNKNOWN);
    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::BondStereo::STEREONONE);

    {
      QImage qimg(400, 400, QImage::Format_ARGB32);
      QPainter qpt(&qimg);
      MolDraw2DQt drawer(qimg.width(), qimg.height(), &qpt);
      drawer.drawOptions().bondLineWidth = 3;
      drawer.drawOptions().scaleHighlightBondWidth = true;
      drawer.drawMolecule(*mol, "wavy bonds");
      qimg.save("testWavyBonds.qt.1.png");
    }
  }

Configuration (please complete the following information):

  • RDKit version: master
  • OS: all
@greglandrum greglandrum added this to the 2022_03_4 milestone Jun 24, 2022
greglandrum added a commit to greglandrum/rdkit that referenced this issue Jun 24, 2022
@greglandrum greglandrum changed the title MolDraw2DQt doesn't draw wavy bonds MolDraw2DQt and MolDraw2DJS don't draw wavy bonds Jun 24, 2022
greglandrum added a commit that referenced this issue Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant