Skip to content

Commit

Permalink
Merge pull request #8 from SevenHuangY/master
Browse files Browse the repository at this point in the history
修复了一个合并重叠区域的BUG,该BUG导致当有超过2个子View处在同一[y1,y2]区域时,填充的文本重叠。
  • Loading branch information
hongyangAndroid authored Aug 17, 2017
2 parents d92c589 + 31c9e03 commit dc81953
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions mixturetextview/src/main/java/com/zhy/view/MixtureTextView.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,31 @@ public int compare(Rect lhs, Rect rhs)

res.remove(pre);
res.remove(next);
res.add(pre = new Rect(left, y1, right, y2));
} else
res.add(new Rect(left, y1, right, y2));

if(res.size() >= 2)
{
pre = rs.get(0);
next = rs.get(1);
}
else
{
break;
}

}
else
{
pre = next;
if((res.size() - i) >= 2)
{
pre = next;
next = rs.get(i + 1);
}
else
{
break;
}
}
next = rs.get(i);
}

rs = res;
Expand Down

0 comments on commit dc81953

Please sign in to comment.