See https://github.com/godotengine/godot/issues/2446. (cherry picked from commit dec20883c1)
dec20883c1