Skip to content

Commit

Permalink
Merge pull request #31 from beaven11/master
Browse files Browse the repository at this point in the history
fix width adaptation
  • Loading branch information
YvesCheung authored Jun 30, 2021
2 parents 3806a9a + d66418d commit af1ac5f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ internal class TextColumn(
}

//计算当前字符宽度,为第一个字符和最后一个字符的过渡宽度
currentWidth = (lastCharWidth - firstCharWidth) * progress.toFloat() + firstCharWidth
currentWidth = if (currentChar.toInt() > 0) {
(lastCharWidth - firstCharWidth) * progress.toFloat() + firstCharWidth
} else {
0f
}

return PreviousProgress(index, offsetPercentage, progress, currentChar, currentWidth)
}
Expand Down

0 comments on commit af1ac5f

Please sign in to comment.