introduce maximum recursion time to solve some edge case #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
under some edge cases, adaptiveOffsetCurve will fail in 'maximum stack' error.
for example:
'M1839.30859375,460.746875 Q1839.30859375,460.796875,1839.30859375,461.064453125 Q1839.30859375,461.33203125,1839.30859375,461.763671875 Q1839.30859375,462.1953125,1838.416015625,467.54296875 Q1837.5234375,472.890625,1830.720703125,486.49609375 Q1823.91796875,500.1015625,1796.701171875,533.046875 Q1769.484375,565.9921875,1748.04296875,586.20703125 Q1726.6015625,606.421875,1666.328125,657.087890625 Q1606.0546875,707.75390625,1541.810546875,757.916015625 Q1477.56640625,808.078125,1405.775390625,868.056640625 Q1333.984375,928.03515625,1285.1640625,971.064453125 Q1236.34375,1014.09375,1203.439453125,1044.802734375 Q1170.53515625,1075.51171875,1154.31640625,1093.408203125 Q1138.09765625,1111.3046875,1136.9921875,1112.2265625 Q1135.88671875,1113.1484375,1136.0078125,1113.02734375 Q1136.12890625,1112.90625,1136.25,1112.90625 Q1136.37109375,1112.90625,1144.734375,1107.583984375 Q1153.09765625,1102.26171875,1177.927734375,1091.029296875 Q1202.7578125,1079.796875,1263.162109375,1055.80078125 Q1323.56640625,1031.8046875,1377.515625,1013.55859375 Q1431.46484375,995.3125,1541.39453125,956.185546875 Q1651.32421875,917.05859375,1751.513671875,882.734375 Q1851.703125,848.41015625,1913.76171875,828.552734375 Q1975.8203125,808.6953125,2062.291015625,784.376953125 Q2148.76171875,760.05859375,2168.400390625,754.890625 Q2188.0390625,749.72265625,2188.3046875,749.72265625 Q2188.5703125,749.72265625,2188.447265625,749.72265625 Q2188.32421875,749.72265625,2188.201171875,749.72265625 Q2188.078125,749.72265625,2187.646484375,749.72265625 Q2187.21484375,749.72265625,2186.783203125,749.72265625 Q2186.3515625,749.72265625,2179.458984375,748.41015625 Q2172.56640625,747.09765625,2164.060546875,743.400390625 Q2155.5546875,739.703125,2149.318359375,736.75 Q2143.08203125,733.796875,2107.666015625,712.548828125 Q2072.25,691.30078125,2031.0859375,657.12890625 Q1989.921875,622.95703125,1929.009765625,575.099609375 Q1868.09765625,527.2421875,1810.4140625,486.525390625 Q1752.73046875,445.80859375,1694.47265625,407.81640625 Q1636.21484375,369.82421875,1610.767578125,353.9921875 Q1585.3203125,338.16015625,1583.203125,336.279296875 Q1581.0859375,334.3984375,1579.98046875,333.6640625 Q1578.875,332.9296875,1578.607421875,332.796875 L1578.28984375,332.6140625'
I introduce a maximum recusion time, 20 times should be enough for a nice offset curve.