Skip to content

Commit 7a189f9

Browse files
committed
Add 15 pixels to the target size
1 parent 826b429 commit 7a189f9

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
733733
y += scrollY
734734

735735
// Check if we're in the task list area
736-
if (isEnabled && x + totalPaddingStart <= (blockFormatter.listStyleLeadingMargin() + 10)) {
736+
if (isEnabled && x + totalPaddingStart <= (blockFormatter.listStyleLeadingMargin() + AztecTaskListSpan.PADDING_SPACE)) {
737737
val line = layout.getLineForVertical(y)
738738
val off = layout.getOffsetForHorizontal(line, x.toFloat())
739739
if (getTaskListHandler()?.handleTaskListClick(

aztec/src/main/kotlin/org/wordpress/aztec/TaskListClickHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import org.wordpress.aztec.spans.AztecTaskListSpan
88
class TaskListClickHandler(val listStyle: BlockFormatter.ListStyle) {
99
fun handleTaskListClick(text: Spannable, off: Int, x: Int, startMargin: Int): Boolean {
1010
// We want to make sure that text click will not trigger the checked change
11-
if (x + startMargin > (listStyle.leadingMargin() + 10)) return false
11+
if (x + startMargin > (listStyle.leadingMargin() + AztecTaskListSpan.PADDING_SPACE)) return false
1212
val clickedList = text.getSpans(off, off, AztecTaskListSpan::class.java).firstOrNull()
1313
val clickedLines = text.getSpans(off, off, AztecListItemSpan::class.java)
1414
val clickedLine = clickedLines.find {

aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecTaskListSpan.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,8 @@ open class AztecTaskListSpan(
144144
}
145145

146146
override val textFormat: ITextFormat = AztecTextFormat.FORMAT_TASK_LIST
147+
148+
companion object {
149+
const val PADDING_SPACE = 15
150+
}
147151
}

0 commit comments

Comments
 (0)