closed #3016: Fixed a bug of LayerGradient that it displays wrong when set content size.