Commit graph

6286 commits

Author SHA1 Message Date
Jürg Lehni
6136bd8143 Fix issue with SVG serialization in newer versions of JSDOM.
And define some meaningful ranges for problematic Node.js modules.

Closes #821
2016-01-07 23:08:01 +01:00
Jürg Lehni
56869baaad Only transform canvas if matrix is not the identity. 2016-01-07 22:07:26 +01:00
Jürg Lehni
7969e4647c Use shadowBlur instead of shadowColor to clear shadows after fills. 2016-01-07 22:06:10 +01:00
Jürg Lehni
d1e4807c6a Allow the use of Formater without additional processing of numbers.
precision >= 16 will output numbers as is.
2016-01-07 18:51:30 +01:00
Jürg Lehni
36a98706b3 Use epsilons when deciding for horizontal winding and dealing with horizontal mono-curves.
Relates to #890#issuecomment-169672571, fixing the 2nd case of the 2nd example.
2016-01-07 15:58:51 +01:00
Jürg Lehni
bc8fb92b9d Rename some variables to be more clear about their role. 2016-01-07 15:55:24 +01:00
Jürg Lehni
5e01774c91 Further simplify checks of crossing vs touching in getWinding()
Relates to #890
2016-01-07 13:09:47 +01:00
Jürg Lehni
231dba83b2 No need to filter intersections if there were no overlaps. 2016-01-07 12:15:11 +01:00
Jürg Lehni
86b9d04c43 Rename from, to parameters to start, end in methods where the end is exclusive.
Relates to #338
2016-01-07 11:29:36 +01:00
Jürg Lehni
af797df5ba Remove includeOverlaps parameter from getCrossings()
And write better comments about how overlaps should be dealt with ideally.
2016-01-07 11:18:46 +01:00
Jürg Lehni
2fc7684efb Optimize new getWinding() code a bit.
By storing additional information along the first curve of a monoCurve loop.
2016-01-07 11:02:51 +01:00
Jürg Lehni
1078e1f8a9 Implement winding fix suggested by @iconexperience.
Along with a unit test for the issue.

Closes #890
2016-01-07 10:02:43 +01:00
Jürg Lehni
e5a62cb919 Fix new failing tests in @iconexperience's test suite.
Relates to comments on 5a16d0cd01
2016-01-07 09:50:07 +01:00
Jürg Lehni
7ad6dc2d5f Add support for Curve objects in smooth() ranges. 2016-01-06 22:37:51 +01:00
Jürg Lehni
5f11345fc9 Implement from / to options for 'continuous' smooth(). 2016-01-06 22:31:02 +01:00
Jürg Lehni
71c7405d6b Some work on documentation structure for #smooth(). 2016-01-06 17:16:04 +01:00
Jürg Lehni
bf4eb47fae Start implementing new smooth() functions that merge all approaches.
Work in progress, needs more work on range handling for 'continous', and docs.
2016-01-06 16:11:19 +01:00
Jürg Lehni
2539527864 Fix minification warnings. 2016-01-06 15:25:37 +01:00
Jürg Lehni
8cec4f972d Handle tiny handles correctly In Curve's evaluate()
If the curve handles are almost zero, reset the control points to the anchors.

Closes #838
2016-01-06 15:03:35 +01:00
Jürg Lehni
b9c76f44e8 Convert "Note: " comments to "NOTE: " and do some cleanup. 2016-01-06 14:23:19 +01:00
Jürg Lehni
7152942719 Replace links to issues with short references. 2016-01-06 14:13:02 +01:00
Jürg Lehni
45a8a69d67 Implement unit tests for #885 and #889 2016-01-06 13:20:45 +01:00
Jürg Lehni
dd082de70a Implement unit tests for PathItem#resolveCrossings() 2016-01-06 13:13:59 +01:00
Jürg Lehni
156dd661ed Detect and handle fully overlapping paths in boolean operations.
Closes #885
2016-01-06 11:54:23 +01:00
Jürg Lehni
feec904288 Fix white-space. 2016-01-06 11:14:38 +01:00
Jürg Lehni
df580425f4 Remove sameDir parameter from isCollinear() agian.
It's not in use anywhere now.
2016-01-06 11:08:17 +01:00
Jürg Lehni
5b98fea3fc Reactivate the previously failing boolean edge case test. 2016-01-06 11:03:53 +01:00
Jürg Lehni
5a16d0cd01 Implement proper handling of self-touching paths in resolveCrossings().
Closes #874, #887
2016-01-06 10:53:50 +01:00
Jürg Lehni
d89995a781 Fix winding calculation in rare edge case.
Closes #889
2016-01-06 00:34:23 +01:00
Jürg Lehni
17d000266f Deactivate use of sameDir in Path#reduce() for now. 2016-01-06 00:27:11 +01:00
Jürg Lehni
cb6afda083 Add sameDir parameter it #isCollinear() functions and use it in Path#reduce(). 2016-01-05 14:51:55 +01:00
Jürg Lehni
0a7bb06d93 Implement suggestions by @iconexperience in #887 2016-01-05 12:43:38 +01:00
Jürg Lehni
928ad48937 Rename start/endConnected to excludeStart/End. 2016-01-05 12:14:21 +01:00
Jürg Lehni
a7fc04a9b1 Improve comments in new getOverlaps() code. 2016-01-05 12:11:56 +01:00
Jürg Lehni
0d172a74f4 Start handling self-overlapping paths in getOverlaps()
Relates to #874 and #887
2016-01-05 12:04:40 +01:00
Jürg Lehni
a6e1a1a76d Deactivate one failing edge case unit test for now.
Relates to #887
2016-01-05 11:14:26 +01:00
Jürg Lehni
d71acb4002 Further simplify boolean operator handling. 2016-01-05 11:10:59 +01:00
Jürg Lehni
1132de0415 Clean up boolean code comments a bit. 2016-01-05 11:06:06 +01:00
Jürg Lehni
4a10fe33d3 Refactor and improve handling of boolean operators.
Also detect a case where all encountered segments are part of overlaps, and add parameter startInOverlaps that handles this situation.

Closes #870
2016-01-05 10:30:33 +01:00
Jürg Lehni
7bb102e218 Update boolean tests to correct intersection results. 2016-01-04 22:36:57 +01:00
Jürg Lehni
472972ed0c Implement unit tests for #870. 2016-01-04 13:20:20 +01:00
Jürg Lehni
bcf000788e Reduce GEOMETRIC_EPSILON again.
Reverting daaf625ebd
2016-01-04 12:53:30 +01:00
Jürg Lehni
e79fefce96 Implement remaining unit tests from #784. 2016-01-04 12:52:22 +01:00
Jürg Lehni
3e3f32329b Implement unit-tests for all of @iconexperience's isolated edge cases.
Relates to #784
2016-01-04 12:20:00 +01:00
Jürg Lehni
34d4115061 Do not modify children array directly
Use Item#remove() to remove children, to make sure indices are kept in sync.
2016-01-04 11:12:56 +01:00
Jürg Lehni
1543d056a7 Add more boolean unit tests from known edge cases. 2016-01-04 11:01:42 +01:00
Jürg Lehni
4e1b26f4e0 Include stroke in boolean operation unit tests.
To compare more than just the filled results, catching additional errors.
2016-01-04 10:47:18 +01:00
Jürg Lehni
9127b13a01 Use GEOMETRIC_EPSILON tolerance when filtering out short curves.
Aligning with tolerances in the rest of the library.
2016-01-04 10:38:51 +01:00
Jürg Lehni
daaf625ebd Double GEOMETRIC_EPSILON to cover the last found edge case.
See https://github.com/paperjs/paper.js/issues/784#issuecomment-168614053
2016-01-04 10:02:58 +01:00
Jürg Lehni
88634d4d3d The paper.browser object might not be initialized yet. 2016-01-03 01:23:17 +01:00