@@ -1644,6 +1644,7 @@ def __init__(self, options=None):
16441644        self .options  =  MoleculeDrawer ().options .copy ()
16451645        self .options .update ({
16461646            'arrowLength' : 36 ,
1647+             'drawReversibleArrow' : True 
16471648        })
16481649        if  options :
16491650            self .options .update (options )
@@ -1744,11 +1745,30 @@ def draw(self, reaction, file_format, path=None):
17441745        rxn_cr .save ()
17451746        rxn_cr .set_source_rgba (0.0 , 0.0 , 0.0 , 1.0 )
17461747        rxn_cr .set_line_width (1.0 )
1747-         rxn_cr .move_to (rxn_x  +  8 , rxn_top  +  0.5  *  rxn_height )
1748-         rxn_cr .line_to (rxn_x  +  arrow_width  -  8 , rxn_top  +  0.5  *  rxn_height )
1749-         rxn_cr .move_to (rxn_x  +  arrow_width  -  14 , rxn_top  +  0.5  *  rxn_height  -  3.0 )
1750-         rxn_cr .line_to (rxn_x  +  arrow_width  -  8 , rxn_top  +  0.5  *  rxn_height )
1751-         rxn_cr .line_to (rxn_x  +  arrow_width  -  14 , rxn_top  +  0.5  *  rxn_height  +  3.0 )
1748+         if  self .options ['drawReversibleArrow' ] and  reaction .reversible :  # draw double harpoons 
1749+             TOP_HARPOON_Y  =  rxn_top  +  (0.5  *  rxn_height  -  1.75 )
1750+             BOTTOM_HARPOON_Y  =  rxn_top  +  (0.5  *  rxn_height  +  1.75 )
1751+ 
1752+             # Draw top harpoon 
1753+             rxn_cr .move_to (rxn_x  +  8 , TOP_HARPOON_Y )
1754+             rxn_cr .line_to (rxn_x  +  arrow_width  -  8 , TOP_HARPOON_Y )
1755+             rxn_cr .move_to (rxn_x  +  arrow_width  -  14 , TOP_HARPOON_Y  -  3.0 )
1756+             rxn_cr .line_to (rxn_x  +  arrow_width  -  8 , TOP_HARPOON_Y )
1757+ 
1758+             # Draw bottom harpoon 
1759+             rxn_cr .move_to (rxn_x  +  arrow_width  -  8 , BOTTOM_HARPOON_Y )
1760+             rxn_cr .line_to (rxn_x  +  8 , BOTTOM_HARPOON_Y )
1761+             rxn_cr .move_to (rxn_x  +  14 , BOTTOM_HARPOON_Y  +  3.0 )
1762+             rxn_cr .line_to (rxn_x  +  8 , BOTTOM_HARPOON_Y )
1763+ 
1764+             
1765+         else :  # draw forward arrow 
1766+             rxn_cr .move_to (rxn_x  +  8 , rxn_top  +  0.5  *  rxn_height )
1767+             rxn_cr .line_to (rxn_x  +  arrow_width  -  8 , rxn_top  +  0.5  *  rxn_height )
1768+             rxn_cr .move_to (rxn_x  +  arrow_width  -  14 , rxn_top  +  0.5  *  rxn_height  -  3.0 )
1769+             rxn_cr .line_to (rxn_x  +  arrow_width  -  8 , rxn_top  +  0.5  *  rxn_height )
1770+             rxn_cr .line_to (rxn_x  +  arrow_width  -  14 , rxn_top  +  0.5  *  rxn_height  +  3.0 )
1771+ 
17521772        rxn_cr .stroke ()
17531773        rxn_cr .restore ()
17541774        rxn_x  +=  arrow_width 
0 commit comments