File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed
media-placeholders/src/main/java/org/wordpress/aztec/placeholders Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ class PlaceholderManager(
135135 val type = attrs.getValue(TYPE_ATTRIBUTE )
136136 val textViewLayout: Layout = aztecText.layout
137137 val parentTextViewRect = Rect ()
138- val targetLineOffset = getLineForOffset(targetPosition)
138+ val targetLineOffset = textViewLayout. getLineForOffset(targetPosition)
139139 if (currentPosition != null ) {
140140 if (targetLineOffset != 0 && currentPosition == targetPosition) {
141141 return
@@ -177,19 +177,6 @@ class PlaceholderManager(
177177 }
178178 }
179179
180- private fun getLineForOffset (offset : Int ): Int {
181- var counter = 0
182- var index = 0
183- for (line in aztecText.text.split(" \n " )) {
184- counter + = line.length + 1
185- if (counter > offset) {
186- break
187- }
188- index + = 1
189- }
190- return index
191- }
192-
193180 private fun validateAttributes (attributes : AztecAttributes ): Boolean {
194181 return attributes.hasAttribute(UUID_ATTRIBUTE ) &&
195182 attributes.hasAttribute(TYPE_ATTRIBUTE ) &&
You can’t perform that action at this time.
0 commit comments