Skip to content

Commit e97da62

Browse files
committed
fix: only add data-atom-map-no when defined
1 parent d229a44 commit e97da62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/actelion/research/chem/SVGDepictor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,11 @@ protected void onDrawBond(int bond, double x1, double y1, double x2, double y2)
220220

221221
@Override
222222
protected void onDrawAtom(int atom, String symbol, double x, double y) {
223+
int atomMapNo = this.getMolecule().getAtomMapNo(atom);
223224
String s = "<circle " +
224225
"id=\"" + getId() + ":Atom:" + atom + "\" " +
225226
"class=\"event\" " + // class to respond to the mouse event
226-
"data-atom-map-no=\"" + this.getMolecule().getAtomMapNo(atom) + "\" " +
227+
(atomMapNo == 0 ? "" : "data-atom-map-no=\"" + atomMapNo + "\" ") +
227228
"cx=\"" + round(x) + "\" " +
228229
"cy=\"" + round(y) + "\" " +
229230
"r=\"" + DEFAULT_ELEM_WIDTH + "\" " +

0 commit comments

Comments
 (0)