Commit graph

4678 commits

Author SHA1 Message Date
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
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
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
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
bcf000788e Reduce GEOMETRIC_EPSILON again.
Reverting daaf625ebd
2016-01-04 12:53:30 +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
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
Jürg Lehni
26761f17a1 Some minor clean-ups for 55cf0bc1c7. 2016-01-03 01:13:03 +01:00
Jürg Lehni
55cf0bc1c7 Improve and simplify handling of start segments.
Removing findStartSegment() and merging functionality into findBestIntersection() leads to simpler code and solves some remaining issue, e.g. https://github.com/paperjs/paper.js/issues/784#issuecomment-153282113
2016-01-03 01:08:11 +01:00
Jürg Lehni
9404c5a0e3 Restructure code from #883 a bit
- Use === instead of == for strict numeric comparisons
- Merge the two return statements to one
- Address some imprecisions in previously added comments
2016-01-02 23:39:13 +01:00
iconexperience
ebaccf6e2d Add break condition for exactly collinear curves to prevent a very time consuming clipping process that cannot have a result. 2016-01-02 19:08:42 +01:00
Jürg Lehni
957d303a0d Make sure the key identifier is always lowercase.
Relates to #881
2016-01-02 13:58:05 +01:00
Jürg Lehni
afffdfdddd Clean up comments a little. 2016-01-02 13:20:36 +01:00
Jürg Lehni
df09e14d53 Address keyIdentifier weirdness in Chrome on Ubuntu.
Closes #881
2016-01-02 13:17:24 +01:00
Jürg Lehni
ce1f04d76c Remove reliance on downKey, since it may differ between keydown and keypress events.
Relates to #881, but unfortunately does not fix it.
2016-01-02 13:02:20 +01:00
Jürg Lehni
3234975e46 Include comment about methods produced on the fly.
For easier searching.
2015-12-31 18:32:56 +01:00
Jürg Lehni
fa15b083b0 Go back to matching curve beginnings / ends with GEOMETRIC_EPSILON.
This is possible because we're handling the special line case separately before already.
2015-12-31 14:23:16 +01:00
Jürg Lehni
f8791f2be5 Perform bounding box checkes with GEOMETRIC_EPSILON
Closes #878
2015-12-31 10:21:38 +01:00
sapics
3f50aadf3b Fix comment of rectangle.expand 2015-12-31 13:04:00 +09:00
Jürg Lehni
df24de0fdf Optimize fat-line clipping code a bit further.
We don't need to calculate v1Clip and tDiff if oldTDiff > 0.5 && tDiff > 0.5.
2015-12-30 23:19:58 +01:00
Jürg Lehni
f19bdf9834 Remove unrequired testContains parameter. 2015-12-30 21:55:22 +01:00
Jürg Lehni
92904e95c2 Address proposal by @iconexperience in #869 and shorten code.
Closes #877
2015-12-30 21:55:22 +01:00
Jürg Lehni
511fc12dd4 Implement more special key lookups in new Key handling code.
Relates to #876.
2015-12-30 21:55:22 +01:00
Jürg Lehni
943c4bba91 Improve horizontal check for sampling points in propagateWinding()
Relates to #875, needs more testing.
2015-12-30 21:55:21 +01:00
Jürg Lehni
a1fcaabed6 Implement item comparison through rasterization and resemble.js diffing, directly integrated into QUnit.
And start using it for boolean operation unit tests.
2015-12-30 21:55:21 +01:00
Jürg Lehni
2596b81616 Add optional insert parameter to #rasterize() 2015-12-30 21:55:21 +01:00
Jürg Lehni
62a23662fa Unify handling of insert parameters. 2015-12-30 21:55:21 +01:00
Jürg Lehni
44f98ee094 Replace all mention of DOM in the documentation with scene graph. 2015-12-30 21:55:21 +01:00
Jürg Lehni
c0a2e0ec63 Support insert parameter again in #toShape() / #toPath() 2015-12-30 21:55:21 +01:00
Jürg Lehni
060ab5e7f9 Only mark overlap segments as visited during #intersect(). 2015-12-30 21:55:21 +01:00
Jürg Lehni
f4f46fa985 Implement optimization suggested by @iconexperience in #869 2015-12-30 21:55:20 +01:00
Jürg Lehni
0e427c16a2 Fix some white-spaces in comments and HTML. 2015-12-30 21:55:20 +01:00
Jürg Lehni
bf65866b58 Port over boolean #intersect() fix from c6b1a8067f5045e94294735a21aa2fa222fbb2a1
Relates to #870
2015-12-30 21:55:20 +01:00
Jürg Lehni
fa9698aaaa Revert back to always call #setClockwise() in #resolveCrossings()
This solves some regressions, e.g. https://github.com/paperjs/paper.js/issues/869#issuecomment-167586249
2015-12-30 21:55:20 +01:00