Skip to content

Commit 85f4333

Browse files
committed
1,修复bug
1 parent ec75574 commit 85f4333

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/src/main/java/com/flyjingfish/gradienttextviewlib/GradientTextView.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ public int[] getGradientStrokeColors() {
223223
public void setGradientStrokeColors(int[] gradientStrokeColors) {
224224
this.gradientStrokeColors = gradientStrokeColors;
225225
gradientStrokeColor = gradientStrokeColors != null;
226+
if (gradientStrokePositions != null && gradientStrokeColors != null && gradientStrokeColors.length != gradientStrokePositions.length){
227+
this.gradientStrokePositions = null;
228+
}
226229
invalidate();
227230
}
228231

@@ -242,6 +245,9 @@ public int[] getGradientColors() {
242245

243246
public void setGradientColors(int[] gradientColors) {
244247
this.gradientColors = gradientColors;
248+
if (gradientPositions != null && gradientColors != null && gradientColors.length != gradientPositions.length){
249+
this.gradientPositions = null;
250+
}
245251
invalidate();
246252
}
247253

0 commit comments

Comments
 (0)