|
@@ -82,19 +82,21 @@ class SongLyricTextView @JvmOverloads constructor(
|
|
|
|
|
|
if (lineWidth <= consumeWidth) {
|
|
|
// 如果是之前已经变色区域,直接添加到path中
|
|
|
+ path.addRect(
|
|
|
+ layout.getLineLeft(i),
|
|
|
+ layout.getLineTop(i).toFloat(),
|
|
|
+ layout.getLineRight(i),
|
|
|
+ layout.getLineBottom(i).toFloat(),
|
|
|
+ Path.Direction.CCW
|
|
|
+ )
|
|
|
+
|
|
|
+ oldStartWidth -= lineWidth
|
|
|
consumeWidth -= lineWidth
|
|
|
-// path.addRect(
|
|
|
-// layout.getLineLeft(i),
|
|
|
-// layout.getLineTop(i).toFloat(),
|
|
|
-// layout.getLineRight(i),
|
|
|
-// layout.getLineBottom(i).toFloat(),
|
|
|
-// Path.Direction.CCW
|
|
|
-// )
|
|
|
} else {
|
|
|
// 如果该行正好是要变色的行,直接改变颜色
|
|
|
// 把需要的consumeWidth放入path中
|
|
|
path.addRect(
|
|
|
- layout.getLineLeft(i),
|
|
|
+ layout.getLineLeft(i)+oldStartWidth,
|
|
|
layout.getLineTop(i).toFloat(),
|
|
|
layout.getLineLeft(i) + consumeWidth,
|
|
|
layout.getLineBottom(i).toFloat(),
|