Path Bool library code cleanup (#2000)

* Remove log statements

* Add feature gates to functions in path.rs

* Fix infinite parsing loop and add new test

* License tweaks

* Remove trailing zero in whole number floats

* Flatten visual-tests directory

* Code review

* Clean up printlines

* Add error handling to path parsing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-09-23 12:16:31 +02:00
committed by GitHub
co-authored by Keavon Chambers
parent 3ddc052538
commit 8a1089938e
175 changed files with 442 additions and 346 deletions
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 21 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.3 KiB

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="297mm"
height="210mm"
viewBox="0 0 297 210"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
>
<defs
id="defs1"/>
<path
id="a"
style="fill:#ff0000;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round"
d="M 212.67152,105 A 64.171516,64.171516 0 0 1 148.5,169.17152 64.171516,64.171516 0 0 1 84.328484,105 64.171516,64.171516 0 0 1 148.5,40.828484 64.171516,64.171516 0 0 1 212.67152,105 Z"/>
<path
id="b"
style="font-weight:600;font-size:50.8px;font-family:FreeSans;-inkscape-font-specification:'FreeSans Semi-Bold';text-align:center;text-anchor:middle;fill:#ff0000;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round"
d="m 83.755387,112.6962 h -7.62 v 37.0332 h 7.62 z m 22.097973,9.144 c -3.4544,0 -5.892801,1.4732 -7.620001,4.5212 v -4.064 H 91.12136 v 38.5064 h 7.111999 v -14.3256 c 1.7272,3.048 4.165601,4.4704 7.620001,4.4704 6.604,0 11.4808,-6.1976 11.4808,-14.5288 0,-8.0772 -4.3688,-14.5796 -11.4808,-14.5796 z m -1.6256,5.9436 c 3.6068,0 5.9944,3.5052 5.9944,8.7376 0,4.9784 -2.4892,8.4836 -5.9944,8.4836 -3.556,0 -5.994401,-3.4544 -5.994401,-8.5852 0,-5.1308 2.438401,-8.636 5.994401,-8.636 z m 23.62201,13.97 h -6.9596 c 0.2032,5.9944 4.6228,9.144 12.954,9.144 9.6012,0 11.9888,-5.4864 11.9888,-9.2964 0,-3.556 -1.778,-5.842 -5.3848,-6.9088 l -8.9916,-2.5908 c -1.9812,-0.6096 -2.4892,-1.016 -2.4892,-2.1336 0,-1.524 1.6256,-2.54 4.1148,-2.54 3.4036,0 5.08,1.2192 5.1308,3.7084 h 6.858 c -0.1016,-5.7912 -4.572,-9.2964 -11.938,-9.2964 -6.9596,0 -11.2776,3.5052 -11.2776,9.144 0,5.3848 4.4196,6.2484 5.9944,6.7564 l 8.4836,2.6416 c 1.778,0.5588 2.3876,1.1176 2.3876,2.2352 0,1.6764 -1.9812,2.6924 -5.2832,2.6924 -4.4704,0 -5.1816,-1.6764 -5.588,-3.556 z m 47.59959,7.9756 v -27.432 h -7.112 v 17.1704 c 0,3.2512 -2.286,5.3848 -5.7404,5.3848 -3.048,0 -4.572,-1.6256 -4.572,-4.9276 v -17.6276 h -7.112 v 19.1008 c 0,6.0452 3.3528,9.4996 9.1948,9.4996 3.7084,0 6.1976,-1.3716 8.2296,-4.4196 v 3.2512 z m 6.60404,-27.432 v 27.432 h 7.112 v -16.4592 c 0,-3.3528 1.8288,-5.3848 4.8768,-5.3848 2.3876,0 3.8608,1.3716 3.8608,3.556 v 18.288 h 7.112 v -16.4592 c 0,-3.3528 1.8288,-5.3848 4.8768,-5.3848 2.3876,0 3.8608,1.3716 3.8608,3.556 v 18.288 h 7.112 v -19.4056 c 0,-5.334 -3.2512,-8.4836 -8.7376,-8.4836 -3.4544,0 -5.8928,1.2192 -8.0264,4.064 -1.3208,-2.5908 -4.064,-4.064 -7.4676,-4.064 -3.1496,0 -5.1816,1.0668 -7.5184,3.8608 v -3.4036 z M 81.012192,49.196201 h -7.62 v 37.0332 h 25.3492 v -6.35 h -17.7292 z m 35.305978,9.144 c -8.382,0 -13.5128,5.5372 -13.5128,14.5288 0,9.0424 5.1308,14.5288 13.5636,14.5288 8.3312,0 13.5636,-5.5372 13.5636,-14.3256 0,-9.2964 -5.0292,-14.732 -13.6144,-14.732 z m 0.0508,5.7404 c 3.9116,0 6.4516,3.5052 6.4516,8.89 0,5.1308 -2.6416,8.6868 -6.4516,8.6868 -3.8608,0 -6.4516,-3.556 -6.4516,-8.7884 0,-5.2324 2.5908,-8.7884 6.4516,-8.7884 z m 18.89761,-5.2832 v 27.432 h 7.112 v -14.5796 c 0,-4.1656 2.0828,-6.2484 6.2484,-6.2484 0.762,0 1.27,0.0508 2.2352,0.2032 v -7.2136 c -0.4064,-0.0508 -0.6604,-0.0508 -0.8636,-0.0508 -3.2512,0 -6.096,2.1336 -7.62,5.842 v -5.3848 z m 31.34362,-0.4572 c -7.874,0 -12.7,5.6896 -12.7,14.8844 0,8.7884 4.7752,14.1732 12.5476,14.1732 6.14679,0 11.12519,-3.5052 12.69999,-8.89 h -7.0104 c -0.8636,2.1844 -2.8448,3.4544 -5.43559,3.4544 -4.7752,0 -5.5372,-3.5052 -5.6896,-7.2136 h 18.38959 c 0.0508,-0.6096 0.0508,-0.8636 0.0508,-1.2192 0,-12.1412 -7.366,-15.1892 -12.85239,-15.1892 z m 5.43559,11.684 H 161.1238 c 0.4572,-4.1656 2.2352,-6.2484 5.3848,-6.2484 3.30199,0 5.23239,2.2352 5.53719,6.2484 z m 12.75081,-11.2268 v 27.432 h 7.112 v -16.4592 c 0,-3.3528 1.8288,-5.3848 4.8768,-5.3848 2.3876,0 3.8608,1.3716 3.8608,3.556 v 18.288 h 7.112 v -16.4592 c 0,-3.3528 1.8288,-5.3848 4.8768,-5.3848 2.3876,0 3.8608,1.3716 3.8608,3.556 v 18.288 h 7.112 v -19.4056 c 0,-5.334 -3.2512,-8.4836 -8.7376,-8.4836 -3.4544,0 -5.8928,1.2192 -8.0264,4.064 -1.3208,-2.5908 -4.064,-4.064 -7.4676,-4.064 -3.1496,0 -5.1816,1.0668 -7.5184,3.8608 v -3.4036 z"/>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="297mm" height="210mm" viewBox="0 0 297 210" version="1.1" id="svg1" xmlns="http://www.w3.org/2000/svg">
<defs id="defs1"/>
<path style="fill:#ff0000;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round" d="M 83.755387000000,112.696200000000 L 76.135387000000,112.696200000000 L 76.135387000000,149.729400000000 L 83.755387000000,149.729400000000 L 83.755387000000,112.696200000000 M 210.390827092771,121.956108583236 A 64.171516000000 64.171516000000 0.000000000000 0 0 212.671520000000,105.000000175080 A 64.171516000000 64.171516000000 0.000000000000 0 0 207.758199999817,80.373801093438 L 207.758200000000,69.770201000000 C 207.758200000000,66.417401000000 209.587000000000,64.385401000000 212.635000000000,64.385401000000 C 215.022600000000,64.385401000000 216.495800000000,65.757001000000 216.495800000000,67.941401000000 L 216.495800000000,86.229401000000 L 223.607800000000,86.229401000000 L 223.607800000000,66.823801000000 C 223.607800000000,61.489801000000 220.356600000000,58.340201000000 214.870200000000,58.340201000000 C 211.415800000000,58.340201000000 208.977400000000,59.559401000000 206.843800000000,62.404201000000 C 205.523000000000,59.813401000000 202.779800000000,58.340201000000 199.376200000000,58.340201000000 C 197.292935294555,58.340201000000 195.698620646900,58.806926055163 194.181643223842,59.931482123758 A 64.171516000000 64.171516000000 0.000000000000 0 0 148.500000000000,40.828484000000 A 64.171516000000 64.171516000000 0.000000000000 0 0 89.449691181417,79.879400999017 L 81.012192000000,79.879401000000 L 81.012192000000,49.196201000000 L 73.392192000000,49.196201000000 L 73.392192000000,86.229401000000 L 87.135123409908,86.229401000000 A 64.171516000000 64.171516000000 0.000000000000 0 0 84.328484000000,105.000000000000 A 64.171516000000 64.171516000000 0.000000000000 0 0 91.121360000746,133.734567465873 L 91.121360000000,160.803800000000 L 98.233359000000,160.803800000000 L 98.233359000000,146.478200000000 C 99.523641919633,148.755169858176 101.210821090084,150.124949561489 103.421965352651,150.672252226666 A 64.171516000000 64.171516000000 0.000000000000 0 0 148.500000000000,169.171520000000 A 64.171516000000 64.171516000000 0.000000000000 0 0 197.903000000613,145.955192339229 L 197.903000000000,149.729400000000 L 205.015000000000,149.729400000000 L 205.015000000000,135.398008751254 A 64.171516000000 64.171516000000 0.000000000000 0 0 208.378992717779,128.075752652522 C 208.842066828601,127.950200956146 209.347493127457,127.885400000000 209.891800000000,127.885400000000 C 212.279400000000,127.885400000000 213.752600000000,129.257000000000 213.752600000000,131.441400000000 L 213.752600000000,149.729400000000 L 220.864600000000,149.729400000000 L 220.864600000000,130.323800000000 C 220.864600000000,124.989800000000 217.613400000000,121.840200000000 212.127000000000,121.840200000000 C 211.517996453175,121.840200000000 210.940571159495,121.878093903773 210.390827092639,121.956108583500 M 200.632322706442,67.580689316501 A 64.171516000000 64.171516000000 0.000000000000 0 0 198.381445638899,64.628905814143 C 199.705004967239,65.077751271713 200.518180692801,66.124562475425 200.632322706763,67.580689316459"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB