fix bug of assertion in draw_pixel