Skip to content

Commit

Permalink
Add 15 pixels to the target size
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo04 committed Jan 23, 2025
1 parent 826b429 commit 7a189f9
Show file tree
Hide file tree
Showing 3 changed files with 6 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() + 10)) {
if (isEnabled && x + totalPaddingStart <= (blockFormatter.listStyleLeadingMargin() + AztecTaskListSpan.PADDING_SPACE)) {
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() + 10)) return false
if (x + startMargin > (listStyle.leadingMargin() + AztecTaskListSpan.PADDING_SPACE)) 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
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,8 @@ open class AztecTaskListSpan(
}

override val textFormat: ITextFormat = AztecTextFormat.FORMAT_TASK_LIST

companion object {
const val PADDING_SPACE = 15
}
}

0 comments on commit 7a189f9

Please sign in to comment.