Merge "Translate text by top" into rvc-dev

This commit is contained in:
Lucas Dupin
2020-04-22 18:42:42 +00:00
committed by Android (Google) Code Review

View File

@@ -166,7 +166,7 @@ public abstract class DynamicDrawableSpan extends ReplacementSpan {
if (mVerticalAlignment == ALIGN_BASELINE) { if (mVerticalAlignment == ALIGN_BASELINE) {
transY -= paint.getFontMetricsInt().descent; transY -= paint.getFontMetricsInt().descent;
} else if (mVerticalAlignment == ALIGN_CENTER) { } else if (mVerticalAlignment == ALIGN_CENTER) {
transY = (bottom - top) / 2 - b.getBounds().height() / 2; transY = top + (bottom - top) / 2 - b.getBounds().height() / 2;
} }
canvas.translate(x, transY); canvas.translate(x, transY);