mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 15:44:24 +00:00
Fix translate and rotate regressions.
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user