bugfix in draw_flexible_mask: if c2=0.0, then s may become NaN due to floating point imperfections