Skip to content

Commit

Permalink
fix: only add data-atom-map-no when defined
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Jan 31, 2024
1 parent d229a44 commit e97da62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/actelion/research/chem/SVGDepictor.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ protected void onDrawBond(int bond, double x1, double y1, double x2, double y2)

@Override
protected void onDrawAtom(int atom, String symbol, double x, double y) {
int atomMapNo = this.getMolecule().getAtomMapNo(atom);
String s = "<circle " +
"id=\"" + getId() + ":Atom:" + atom + "\" " +
"class=\"event\" " + // class to respond to the mouse event
"data-atom-map-no=\"" + this.getMolecule().getAtomMapNo(atom) + "\" " +
(atomMapNo == 0 ? "" : "data-atom-map-no=\"" + atomMapNo + "\" ") +
"cx=\"" + round(x) + "\" " +
"cy=\"" + round(y) + "\" " +
"r=\"" + DEFAULT_ELEM_WIDTH + "\" " +
Expand Down

0 comments on commit e97da62

Please sign in to comment.