Skip to content

Commit

Permalink
1,修复设置四个方向的图片,删除线和下划线错位问题
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Mar 31, 2023
1 parent 17cd3e8 commit 0fd888f
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,11 @@ class FormatTextView : BaseTextView {
val bound = Rect()
val line = layout.getLineForOffset(index)
val baseline = layout.getLineBaseline(line)
bound.bottom = baseline
bound.left = layout.getPrimaryHorizontal(index).toInt()
bound.right = layout.getPrimaryHorizontal(index + 1).toInt()
bound.bottom = baseline+compoundPaddingTop
bound.left = layout.getPrimaryHorizontal(index).toInt()+compoundPaddingLeft
bound.right = layout.getPrimaryHorizontal(index + 1).toInt()+compoundPaddingLeft
if (bound.right < bound.left) {
bound.right = layout.getLineRight(line).toInt()
bound.right = layout.getLineRight(line).toInt()+compoundPaddingLeft
}
return bound;
}
Expand All @@ -456,11 +456,11 @@ class FormatTextView : BaseTextView {
val layout = layout
val bound = Rect()
val line = layout.getLineForOffset(index)
bound.bottom = layout.getLineBaseline(line)
bound.left = layout.getPrimaryHorizontal(index).toInt()
bound.right = layout.getPrimaryHorizontal(index + 1).toInt()
bound.bottom = layout.getLineBaseline(line)+compoundPaddingTop
bound.left = layout.getPrimaryHorizontal(index).toInt()+compoundPaddingLeft
bound.right = layout.getPrimaryHorizontal(index + 1).toInt()+compoundPaddingLeft
if (bound.right < bound.left) {
bound.right = layout.getLineRight(line).toInt()
bound.right = layout.getLineRight(line).toInt()+compoundPaddingLeft
}
return bound;
}
Expand Down

0 comments on commit 0fd888f

Please sign in to comment.