Skip to content

Commit

Permalink
1、修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Jun 6, 2023
1 parent a91e93d commit a9b3c3b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected void onDraw(Canvas canvas) {
textPaint.setStrokeMiter(defaultStrokeMiter);
}
LinearGradient linearGradient;
if (gradientStrokeColor){
if (gradientStrokeColor && gradientStrokeColors != null && gradientStrokeColors.length > 1){
float currentAngle = strokeAngle;
if (strokeRtlAngle && isRtl){
currentAngle = - strokeAngle;
Expand All @@ -251,7 +251,7 @@ protected void onDraw(Canvas canvas) {

textPaint.setStrokeWidth(0);
textPaint.setStyle(oldStyle);
if (gradientColor){
if (gradientColor && gradientColors != null && gradientColors.length > 1){
float currentAngle = angle;
if (rtlAngle && isRtl){
currentAngle = - angle;
Expand Down Expand Up @@ -405,7 +405,7 @@ public void setGradientColors(@Nullable ColorStateList[] colorStateLists) {
if (gradientColorStates.size() == 1){
gradientColorStates.add(ColorStateList.valueOf(Color.TRANSPARENT));
}
gradientStrokeColor = gradientColorStates.size() > 0;
gradientColor = gradientColorStates.size() > 0;
if (gradientPositions != null && gradientColorStates.size() != gradientPositions.length){
this.gradientPositions = null;
}
Expand Down

0 comments on commit a9b3c3b

Please sign in to comment.