Skip to content

Commit 0574c28

Browse files
committed
add tests for highlight colour
1 parent 0a0047e commit 0574c28

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Code/GraphMol/MolDraw2D/test1.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void test3(){
215215
WedgeMolBonds(*m,&(m->getConformer()));
216216
static const int ha[] = {0,3,4,5};
217217
std::vector<int> highlight_atoms(ha, ha+sizeof(ha)/sizeof(int));
218-
218+
219219
#ifdef RDK_CAIRO_BUILD
220220
{
221221
cairo_surface_t *surface =
@@ -251,6 +251,9 @@ void test3(){
251251
WedgeMolBonds(*m,&(m->getConformer()));
252252
static const int ha[] = {11,12,13,14,15,16};
253253
std::vector<int> highlight_atoms(ha, ha+sizeof(ha)/sizeof(int));
254+
std::map<int,DrawColour> highlight_colors;
255+
highlight_colors[12]=DrawColour(0,0,1);
256+
highlight_colors[13]=DrawColour(0,1,0);
254257

255258
#ifdef RDK_CAIRO_BUILD
256259
{
@@ -260,7 +263,7 @@ void test3(){
260263

261264
MolDraw2DCairo drawer(300,300,cr);
262265
drawer.drawOptions().circleAtoms=true;
263-
drawer.drawMolecule(*m,&highlight_atoms);
266+
drawer.drawMolecule(*m,&highlight_atoms,&highlight_colors);
264267
drawer.finishDrawing();
265268

266269
cairo_destroy (cr);
@@ -272,7 +275,7 @@ void test3(){
272275
std::ofstream outs((nameBase+".svg").c_str());
273276
MolDraw2DSVG drawer(300,300,outs);
274277
drawer.drawOptions().circleAtoms=true;
275-
drawer.drawMolecule(*m,&highlight_atoms);
278+
drawer.drawMolecule(*m,&highlight_atoms,&highlight_colors);
276279
drawer.finishDrawing();
277280
outs.flush();
278281
}

0 commit comments

Comments
 (0)