Fix TextStyle decode misalignment (flutter/engine#8141)

This commit is contained in:
Gary Qian 2019-03-12 13:55:31 -07:00 committed by GitHub
parent 3092eb348c
commit 37babafb43
2 changed files with 10 additions and 10 deletions

View File

@ -297,21 +297,21 @@ Int32List _encodeTextStyle(
result[0] |= 1 << 4;
result[4] = decorationStyle.index;
}
if (decorationThickness != null) {
result[0] |= 1 << 5;
}
if (fontWeight != null) {
result[0] |= 1 << 6;
result[0] |= 1 << 5;
result[5] = fontWeight.index;
}
if (fontStyle != null) {
result[0] |= 1 << 7;
result[0] |= 1 << 6;
result[6] = fontStyle.index;
}
if (textBaseline != null) {
result[0] |= 1 << 8;
result[0] |= 1 << 7;
result[7] = textBaseline.index;
}
if (decorationThickness != null) {
result[0] |= 1 << 8;
}
if (fontFamily != null || (fontFamilyFallback != null && fontFamilyFallback.isNotEmpty)) {
result[0] |= 1 << 9;
// Passed separately to native.

View File

@ -33,10 +33,10 @@ const int tsColorIndex = 1;
const int tsTextDecorationIndex = 2;
const int tsTextDecorationColorIndex = 3;
const int tsTextDecorationStyleIndex = 4;
const int tsTextDecorationThicknessIndex = 5;
const int tsFontWeightIndex = 6;
const int tsFontStyleIndex = 7;
const int tsTextBaselineIndex = 8;
const int tsFontWeightIndex = 5;
const int tsFontStyleIndex = 6;
const int tsTextBaselineIndex = 7;
const int tsTextDecorationThicknessIndex = 8;
const int tsFontFamilyIndex = 9;
const int tsFontSizeIndex = 10;
const int tsLetterSpacingIndex = 11;