Commit graph

6965 commits

Author SHA1 Message Date
Jan
3b8d3cc47d Use Math..SQRT1_2 instead of 0.7071
Makes code easier to understand.
2016-08-31 23:29:35 +02:00
Jan
f160e74936 Use correct value for y 45 degree tangent
I got the pythagoras wrong when I wrote this. The length of the tangent vector is 1, therefore the y component is sqrt(0.5) for 45°. This will not make any difference, but still we should use the correct value.
2016-08-31 10:05:47 +02:00
Jürg Lehni
6e7fe67a8d Implement unit tests for #1109. 2016-08-09 10:01:35 +02:00
Jürg Lehni
cecd95e039 SVG: Correctly handle multiple sequential move commands.
Closes #1134
2016-08-07 21:36:03 +02:00
Jürg Lehni
7a63afc769 Clean up Layer unit tests a bit. 2016-08-07 15:58:54 +02:00
Jürg Lehni
0396446c4c Boolean: Clean up previous fix. 2016-08-07 15:55:27 +02:00
Jürg Lehni
e3dae5f96f Merge pull request #1133 from sapics/remove-layer
Fix to remove named layer
2016-08-07 15:55:17 +02:00
sapics
31690cb6b6 Fix to remove named layer 2016-08-06 11:00:29 +09:00
Jürg Lehni
75a10fb246 Boolean: Clear branch so we start with a new one on the next contour. 2016-08-04 12:21:58 +02:00
Jürg Lehni
79661c35e6 Some code cleanup in View#setViewSize() 2016-08-03 13:33:58 +02:00
Jürg Lehni
91371c1b47 Keep view.bounds in sync during 'resize' events.
Closes #1127
2016-08-03 13:08:08 +02:00
Jürg Lehni
fa3456341c Fix view flickering during window resizes.
Closes #1126
2016-08-01 17:10:00 +02:00
Jürg Lehni
78c5c27bb3 Boolean: More work on new branching code.
It now checks all intersections when there are multiple options first.
2016-07-28 12:14:02 +02:00
Jürg Lehni
f4f4b3472f Minor code optimization. 2016-07-27 22:58:57 +02:00
Jürg Lehni
17cca2984b Boolean: Make sure we're actually comparing multiple intersections. 2016-07-27 22:57:08 +02:00
Jürg Lehni
4c12f1505c Clean up previous commit. 2016-07-27 21:48:55 +02:00
Jürg Lehni
445d8ae22f Boolean: Implement branch structure to be able to go back on traces and try different crossings.
Relates to #1073
2016-07-27 21:40:53 +02:00
Jürg Lehni
bcd02129a3 Implement additional unit test for #1054. 2016-07-27 20:12:29 +02:00
Jürg Lehni
c80c13eb9e Remove _closed parameter from PathItem#isClockwise() again. 2016-07-27 19:41:23 +02:00
Jürg Lehni
14b2d76450 Boolean: Improve handling of visited segments in intersect() operations.
Closes #1123
2016-07-27 19:35:19 +02:00
Jürg Lehni
aee9a3190d Improve handling of straight closing curves in open path checks. 2016-07-27 19:09:42 +02:00
Jürg Lehni
e643338422 Add options object to boolean operations and improve handling of open paths.
This closes #1036, closes #1072, closes #1089 and closes #1121
2016-07-27 17:09:52 +02:00
Jürg Lehni
a29ada8f23 Rename PathIterator back to PathFlattener. 2016-07-27 14:18:01 +02:00
Jürg Lehni
753b27afe0 Minor code and comments cleanup. 2016-07-27 14:11:58 +02:00
Jürg Lehni
9a49c2141c Two minor fixes in Base. 2016-07-26 10:25:32 +02:00
Jürg Lehni
34c57a47fa Use faster loop to handle prioritize in Base.filter() 2016-07-26 10:20:30 +02:00
Jürg Lehni
3f76bd99ef Implement an efficient mechanism to prioritize key in Item#set()
Closes #1096
2016-07-25 23:17:45 +02:00
Jürg Lehni
4954f5d6ab Improve Style#equals() to correctly handle default values.
Closes #1084
2016-07-25 21:42:06 +02:00
Jürg Lehni
29768c8228 Take Color#alpha default into account in Color#equals()
Relates to #1084
2016-07-25 21:09:53 +02:00
Jürg Lehni
e2e024f8a5 Winding: Don't mix up onPath and onCurve. 2016-07-23 18:50:58 +02:00
Jürg Lehni
31732917c0 Winding: Improve handling of on-curve tangent checks. 2016-07-23 13:30:40 +02:00
Jürg Lehni
27af304414 Improve new getWinding() direction flipping code. 2016-07-22 23:30:36 +02:00
Jürg Lehni
eab0b9db5e Correctly handle path.replaceWith(path) calls.
Closes #1118
2016-07-22 23:29:33 +02:00
Jürg Lehni
0b11f9e2dc Allow getWinding() to flip direction when on the path.
Flipping will only occur when the encountered tangent is parallel to the ray. Relates to #1116
2016-07-22 16:50:39 +02:00
Jürg Lehni
cbe41c536e Boolean: Return the full winding object from _getWinding() and use it to improve PathItem#contains() with even-odd full-rule.
Also store the full winding object on the processed segments, to have more information available in boolean operations.
2016-07-22 15:46:42 +02:00
Jürg Lehni
23f3097f84 Facilitate code minification in PathIterator. 2016-07-22 14:21:35 +02:00
Jürg Lehni
becac4c921 Use shorter zero checks for array indices and length.
Keeping === 0 for mathematical algorithms seems clearer.
2016-07-22 13:46:24 +02:00
Jürg Lehni
3d57216ffe Update test for #944 to work with new way of handling compound-paths.
But keep deactivated as it is currently failing, see #1116
2016-07-22 13:15:05 +02:00
Jürg Lehni
a5d04ef97c Address minor omission in previous commit. 2016-07-22 00:05:21 +02:00
Jürg Lehni
a5a0e90bee Implement PathItem#compare() to support compound-paths.
Still needs testing.
2016-07-21 23:07:01 +02:00
Jürg Lehni
ccac7ec7c5 Implement Path#compare() to compare for geometric equality of shapes.
Use it in boolean operations when handling fully overlapping paths.

Relates to #1109
2016-07-21 20:57:39 +02:00
Jürg Lehni
baf58fb021 Improve documentation of PathItem#getArea() and PathItem#isClockwise() 2016-07-21 15:30:31 +02:00
Jürg Lehni
a0417040f8 Improve handling of sub-path orientation in CompoundPath.
Remove automatic orientation on insertion, as it caused more troubles than solved problems, in favor of the new PathItem#reorient() method, or the even-odd fill-rule.

Closes #590, #1029
2016-07-21 15:21:45 +02:00
Jürg Lehni
fc72c05e69 Add sort parameter to PathItem#reorient()
And improve documentation. Relates to #590, WIP
2016-07-21 13:50:55 +02:00
Jürg Lehni
16e53cc1ad Minor reformatting and changes.
no need for paper namespace in unit test code
2016-07-20 17:58:47 +02:00
Jürg Lehni
58991a569e Merge pull request #1115 from iconexperience/addCurveIntersections-patch
Improve fat line clipping to fix #1088
2016-07-20 17:56:04 +02:00
Jan
381e92501a Add test for #1088 2016-07-20 16:33:13 +02:00
Jürg Lehni
a683486ff5 Some code cleanup for previous commits, and shorten boolean tests a bit. 2016-07-20 16:32:21 +02:00
Jan
4c61153bd4 Improve fat line clipping to fix #1088
Only alternate curves in addCurveIntersections() if interval on other curve is not tight enough yet.
2016-07-20 16:32:20 +02:00
Jürg Lehni
f988445dad Boolean: Implement optimization for operands without crossings.
Closes #1113
2016-07-20 16:15:10 +02:00