Skip to content

Commit 73b5511

Browse files
committed
Fixed paragraph span in quotes
1 parent 32cee4d commit 73b5511

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ class EndOfParagraphMarker(var verticalPadding: Int = 0) : LineHeightSpan, Updat
1212
val spanned = text as Spanned
1313
val spanEnd = spanned.getSpanEnd(this)
1414

15+
val actualPadding: Int
16+
17+
if (spanned.getSpans(spanEnd, spanEnd, AztecQuoteSpan::class.java).any { spanned.getSpanEnd(it) == spanEnd }) {
18+
actualPadding = 0
19+
} else {
20+
actualPadding = verticalPadding * 2
21+
}
22+
1523
if (end == spanEnd) {
1624
//padding is applied only to the bottom of paragraph, so we multiply it by 2
17-
fm.descent += verticalPadding * 2
18-
fm.bottom += verticalPadding * 2
25+
fm.descent += actualPadding
26+
fm.bottom += actualPadding
1927
}
2028
}
2129
}

0 commit comments

Comments
 (0)