Fix translate and rotate regressions.

This commit is contained in:
Mikael Sand
2017-07-22 16:20:04 +03:00
parent 7c05e038b2
commit 81044e480a
2 changed files with 6 additions and 9 deletions
@@ -298,11 +298,9 @@ class GlyphContext {
mRIndices.set(index, rotationIndex + 1); mRIndices.set(index, rotationIndex + 1);
} }
int nextIndex = mRIndex + 1; mRIndex = Math.min(mRIndex + 1, mRs.length - 1);
if (nextIndex < mRs.length) {
mRIndex = nextIndex; mr = mRs[mRIndex];
mr = mRs[nextIndex];
}
return mr; return mr;
} }
@@ -187,7 +187,6 @@ class TSpanShadowNode extends TextShadowNode {
matrix = new Matrix(); matrix = new Matrix();
float xSum = offset + x + dx - width; float xSum = offset + x + dx - width;
float ySum = y + dy;
if (textPath != null) { if (textPath != null) {
float halfway = width / 2; float halfway = width / 2;
@@ -202,11 +201,11 @@ class TSpanShadowNode extends TextShadowNode {
assert pm != null; assert pm != null;
pm.getMatrix(midpoint, matrix, POSITION_MATRIX_FLAG | TANGENT_MATRIX_FLAG); pm.getMatrix(midpoint, matrix, POSITION_MATRIX_FLAG | TANGENT_MATRIX_FLAG);
matrix.preTranslate(-halfway, 0); matrix.preTranslate(-halfway, dy);
matrix.preScale(renderMethodScaling, renderMethodScaling); matrix.preScale(renderMethodScaling, renderMethodScaling);
matrix.postTranslate(0, ySum); matrix.postTranslate(0, y);
} else { } else {
matrix.setTranslate(xSum, ySum); matrix.setTranslate(xSum, y + dy);
} }
matrix.preRotate(r); matrix.preRotate(r);