Skip to content

Commit

Permalink
Increase the touching are by 10 pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo04 committed Jan 23, 2025
1 parent d04a133 commit 826b429
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
y += scrollY

// Check if we're in the task list area
if (isEnabled && x + totalPaddingStart <= blockFormatter.listStyleLeadingMargin()) {
if (isEnabled && x + totalPaddingStart <= (blockFormatter.listStyleLeadingMargin() + 10)) {
val line = layout.getLineForVertical(y)
val off = layout.getOffsetForHorizontal(line, x.toFloat())
if (getTaskListHandler()?.handleTaskListClick(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.wordpress.aztec.spans.AztecTaskListSpan
class TaskListClickHandler(val listStyle: BlockFormatter.ListStyle) {
fun handleTaskListClick(text: Spannable, off: Int, x: Int, startMargin: Int): Boolean {
// We want to make sure that text click will not trigger the checked change
if (x + startMargin > listStyle.leadingMargin()) return false
if (x + startMargin > (listStyle.leadingMargin() + 10)) return false
val clickedList = text.getSpans(off, off, AztecTaskListSpan::class.java).firstOrNull()
val clickedLines = text.getSpans(off, off, AztecListItemSpan::class.java)
val clickedLine = clickedLines.find {
Expand Down

0 comments on commit 826b429

Please sign in to comment.