Skip to content

Commit 271e95d

Browse files
committed
fix(mobile): keep the chip hit test within detekt's return limit
1 parent faca193 commit 271e95d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,15 +457,15 @@ class T3ComposerEditorView(context: Context, appContext: AppContext) : ExpoView(
457457
val x = viewX - editor.totalPaddingLeft + editor.scrollX
458458
val y = viewY - editor.totalPaddingTop + editor.scrollY
459459
val line = layout.getLineForOffset(token.start)
460-
if (y < layout.getLineTop(line) || y > layout.getLineBottom(line)) return false
461460
val left = layout.getPrimaryHorizontal(token.start)
462461
val right =
463462
if (layout.getLineForOffset(token.end) == line) {
464463
layout.getPrimaryHorizontal(token.end)
465464
} else {
466465
layout.getLineRight(line)
467466
}
468-
return x >= minOf(left, right) && x <= maxOf(left, right)
467+
return y >= layout.getLineTop(line) && y <= layout.getLineBottom(line) &&
468+
x >= minOf(left, right) && x <= maxOf(left, right)
469469
}
470470

471471
private fun applyTokenSpans() {

0 commit comments

Comments
 (0)