@@ -443,11 +443,11 @@ class FormatTextView : BaseTextView {
443443 val bound = Rect ()
444444 val line = layout.getLineForOffset(index)
445445 val baseline = layout.getLineBaseline(line)
446- bound.bottom = baseline
447- bound.left = layout.getPrimaryHorizontal(index).toInt()
448- bound.right = layout.getPrimaryHorizontal(index + 1 ).toInt()
446+ bound.bottom = baseline+ compoundPaddingTop
447+ bound.left = layout.getPrimaryHorizontal(index).toInt()+ compoundPaddingLeft
448+ bound.right = layout.getPrimaryHorizontal(index + 1 ).toInt()+ compoundPaddingLeft
449449 if (bound.right < bound.left) {
450- bound.right = layout.getLineRight(line).toInt()
450+ bound.right = layout.getLineRight(line).toInt()+ compoundPaddingLeft
451451 }
452452 return bound;
453453 }
@@ -456,11 +456,11 @@ class FormatTextView : BaseTextView {
456456 val layout = layout
457457 val bound = Rect ()
458458 val line = layout.getLineForOffset(index)
459- bound.bottom = layout.getLineBaseline(line)
460- bound.left = layout.getPrimaryHorizontal(index).toInt()
461- bound.right = layout.getPrimaryHorizontal(index + 1 ).toInt()
459+ bound.bottom = layout.getLineBaseline(line)+ compoundPaddingTop
460+ bound.left = layout.getPrimaryHorizontal(index).toInt()+ compoundPaddingLeft
461+ bound.right = layout.getPrimaryHorizontal(index + 1 ).toInt()+ compoundPaddingLeft
462462 if (bound.right < bound.left) {
463- bound.right = layout.getLineRight(line).toInt()
463+ bound.right = layout.getLineRight(line).toInt()+ compoundPaddingLeft
464464 }
465465 return bound;
466466 }
0 commit comments