Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion rdeditor/molViewWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,18 @@ def sanitizeDrawMol(self, kekulize=False, drawkekulize=False):
finishedDrawing = QtCore.Signal(name="finishedDrawing")

def getMolSvg(self):
self.drawer = rdMolDraw2D.MolDraw2DSVG(300, 300)
height = 300
width = 300
self.drawer = rdMolDraw2D.MolDraw2DSVG(width, height)
# TODO, what if self._drawmol doesn't exist?
if self._drawmol is not None:
# Chiral tags on R/S
# chiraltags = Chem.FindMolChiralCenters(self._drawmol)
opts = self.drawer.drawOptions()
opts.fixedBondLength = 15.0
maxv = Point2D(0.5 * width / opts.scalingFactor, 0.5 * height / opts.scalingFactor)
minv = Point2D(-maxv.x, -maxv.y)
self.drawer.SetScale(width, height, minv, maxv)
if self._darkmode:
rdMolDraw2D.SetDarkMode(opts)
if (not self.molecule_sanitizable) and self.unsanitizable_background_colour:
Expand Down
4 changes: 0 additions & 4 deletions rdeditor/templatehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ def apply_template_to_canvas(self, mol: Chem.Mol, point: Point2D, templatelabel:
"""Apply to canvas"""
template = Chem.MolFromSmiles(self.templates[templatelabel]["canvas"], sanitize=False)

if mol.GetNumAtoms() == 0:
point.x = 0.0
point.y = 0.0

combined = Chem.rdchem.RWMol(Chem.CombineMols(mol, template))
# This should only trigger if we have an empty canvas
if not combined.GetNumConformers():
Expand Down
Loading