Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
fix: marker viewBox translation
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Oct 2, 2019
1 parent b28593a commit b111028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion android/src/main/java/com/horcrux/svg/MarkerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ void renderMarker(Canvas canvas, Paint paint, float opacity, RNSVGMarkerPosition
if (mAlign != null) {
RectF vbRect = new RectF(mMinX * mScale, mMinY * mScale, (mMinX + mVbWidth) * mScale, (mMinY + mVbHeight) * mScale);
Matrix viewBoxMatrix = ViewBox.getTransform(vbRect, eRect, mAlign, mMeetOrSlice);
canvas.concat(viewBoxMatrix);
float[] values = new float[9];
viewBoxMatrix.getValues(values);
canvas.scale(values[Matrix.MSCALE_X], values[Matrix.MSCALE_Y]);
}

double x = relativeOnWidth(mRefX);
Expand Down
2 changes: 1 addition & 1 deletion ios/Elements/RNSVGMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ - (void)renderMarker:(CGContextRef)context rect:(CGRect)rect position:(RNSVGMark
eRect:eRect
align:self.align
meetOrSlice:self.meetOrSlice];
CGContextConcatCTM(context, viewBoxTransform);
CGContextScaleCTM(context, viewBoxTransform.a, viewBoxTransform.d);
}

CGFloat x = [self relativeOnWidth:self.refX];
Expand Down

0 comments on commit b111028

Please sign in to comment.