Fix a bug of gradient for Star and Line.