mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 15:14:18 +00:00
[android] initial CTM is identity
This commit is contained in:
@@ -211,7 +211,6 @@ abstract public class RenderableShadowNode extends VirtualNode {
|
|||||||
RectF clientRect = new RectF();
|
RectF clientRect = new RectF();
|
||||||
mPath.computeBounds(clientRect, true);
|
mPath.computeBounds(clientRect, true);
|
||||||
Matrix svgToViewMatrix = new Matrix(canvas.getMatrix());
|
Matrix svgToViewMatrix = new Matrix(canvas.getMatrix());
|
||||||
svgToViewMatrix.preConcat(this.getSvgShadowNode().getInvInitialCTM());
|
|
||||||
svgToViewMatrix.mapRect(clientRect);
|
svgToViewMatrix.mapRect(clientRect);
|
||||||
this.setClientRect(clientRect);
|
this.setClientRect(clientRect);
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
|||||||
private int mMeetOrSlice;
|
private int mMeetOrSlice;
|
||||||
private Matrix mInvViewBoxMatrix = new Matrix();
|
private Matrix mInvViewBoxMatrix = new Matrix();
|
||||||
private boolean mInvertible = true;
|
private boolean mInvertible = true;
|
||||||
private Matrix initialCTM;
|
|
||||||
private Matrix invInitialCTM;
|
|
||||||
|
|
||||||
|
|
||||||
public SvgViewShadowNode() {
|
public SvgViewShadowNode() {
|
||||||
@@ -151,9 +149,6 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
|||||||
|
|
||||||
void drawChildren(final Canvas canvas) {
|
void drawChildren(final Canvas canvas) {
|
||||||
mCanvas = canvas;
|
mCanvas = canvas;
|
||||||
this.initialCTM = canvas.getMatrix();
|
|
||||||
this.invInitialCTM = new Matrix();
|
|
||||||
this.initialCTM.invert(this.invInitialCTM);
|
|
||||||
if (mAlign != null) {
|
if (mAlign != null) {
|
||||||
RectF vbRect = getViewBox();
|
RectF vbRect = getViewBox();
|
||||||
float width = getLayoutWidth();
|
float width = getLayoutWidth();
|
||||||
@@ -285,11 +280,4 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Matrix getInitialCTM() {
|
|
||||||
return this.initialCTM;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Matrix getInvInitialCTM() {
|
|
||||||
return this.invInitialCTM;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user