Skip to content

Commit bcf903c

Browse files
committed
Use direction to decide the drawable shift
1 parent 81773c7 commit bcf903c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ open class AztecTaskListSpan(
104104
} else {
105105
d.state = intArrayOf()
106106
}
107-
d.setBounds((leftBound - drawableHeight*0.8).toInt(), (baseline - drawableHeight*0.8).toInt(), (leftBound + drawableHeight*0.2).toInt(), (baseline + drawableHeight*0.2).toInt())
107+
val (startShift, endShift) = if (dir > 0) {
108+
0.8 to 0.2
109+
} else {
110+
0.2 to 0.8
111+
}
112+
d.setBounds((leftBound - drawableHeight*startShift).toInt(), (baseline - drawableHeight*0.8).toInt(), (leftBound + drawableHeight*endShift).toInt(), (baseline + drawableHeight*0.2).toInt())
108113
d.draw(c)
109114

110115
p.color = oldColor

0 commit comments

Comments
 (0)