File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
app/depict/src/main/java/org/openscience/cdk/depict Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -979,8 +979,15 @@ public DepictionGenerator withCarbonSymbols() {
979979 */
980980 public DepictionGenerator withHighlight (Iterable <? extends IChemObject > chemObjs , Color color ) {
981981 DepictionGenerator copy = new DepictionGenerator (this );
982- for (IChemObject chemObj : chemObjs )
983- copy .highlight .put (chemObj , color );
982+ for (IChemObject chemObj : chemObjs ) {
983+ if (chemObj instanceof IAtomContainer ) {
984+ for (IAtom atom : ((IAtomContainer ) chemObj ).atoms ())
985+ copy .highlight .put (atom , color );
986+ for (IBond bond : ((IAtomContainer ) chemObj ).bonds ())
987+ copy .highlight .put (bond , color );
988+ }
989+ else copy .highlight .put (chemObj , color );
990+ }
984991 return copy ;
985992 }
986993
You can’t perform that action at this time.
0 commit comments