Fix drawing issue on osx