File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
aztec/src/main/kotlin/org/wordpress/aztec/spans Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ open class AztecHeadingSpan(
81
81
82
82
var previousFontMetrics: Paint .FontMetricsInt ? = null
83
83
var previousTextScale: Float = 1.0f
84
+ var previousSpacing: Float? = null
84
85
85
86
enum class Heading constructor(internal val scale : Float , internal val tag : String ) {
86
87
H1 (SCALE_H1 , " h1" ),
@@ -163,10 +164,11 @@ open class AztecHeadingSpan(
163
164
164
165
override fun updateMeasureState (textPaint : TextPaint ) {
165
166
// when font size changes - reset cached font metrics to reapply vertical padding
166
- if (previousTextScale != heading.scale) {
167
+ if (previousTextScale != heading.scale || previousSpacing != textPaint.fontSpacing ) {
167
168
previousFontMetrics = null
168
169
}
169
170
previousTextScale = heading.scale
171
+ previousSpacing = textPaint.fontSpacing
170
172
171
173
textPaint.textSize * = heading.scale
172
174
}
You can’t perform that action at this time.
0 commit comments