Skip to content

Commit 0409f37

Browse files
authored
resolves On Android devices "getPointAtLength" function returns incorrect values (#1727)
While computing the point at length I have passed in the scaled value for path length.
1 parent 3a04189 commit 0409f37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/com/horcrux/svg/RNSVGRenderableManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public WritableMap getPointAtLength(int tag, ReadableMap options) {
124124

125125
float[] pos = new float[2];
126126
float[] tan = new float[2];
127-
float distance = Math.max(0, Math.min(length, pm.getLength()));
127+
float distance = Math.max(0, Math.min(length * scale, pm.getLength()));
128128
pm.getPosTan(distance, pos, tan);
129129

130130
double angle = Math.atan2(tan[1], tan[0]);

0 commit comments

Comments
 (0)