Skip to content

Commit 7e6289f

Browse files
committed
Apply suggestions from review
1 parent ca3402b commit 7e6289f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

presentation/src/main/java/org/cryptomator/presentation/ui/fragment/TextEditorFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ class TextEditorFragment : BaseFragment<FragmentTextEditorBinding>(FragmentTextE
146146
val scroll = binding.textViewWrapper
147147
val layout = editor.layout ?: return
148148
val line = layout.getLineForOffset(editor.selectionEnd)
149-
val lineTop = layout.getLineTop(line)
150-
val lineBottom = layout.getLineBottom(line)
149+
val lineTop = editor.paddingTop + layout.getLineTop(line)
150+
val lineBottom = editor.paddingTop + layout.getLineBottom(line)
151151
val visibleHeight = scroll.height - scroll.paddingTop - scroll.paddingBottom
152152
when {
153153
lineTop < scroll.scrollY -> scroll.smoothScrollTo(0, lineTop)

0 commit comments

Comments
 (0)