Commit graph

6161 commits

Author SHA1 Message Date
Jürg Lehni
4678697638 Some refactoring and added comments to @sapics code in Curve.getNearestParameter() 2015-10-24 11:14:08 +02:00
Jürg Lehni
cbefa668f4 Merge pull request #811 from sapics/faster-nearest-parameter
Faster curve.getNearestParameter when curve has no handles
2015-10-24 10:41:51 +02:00
Jürg Lehni
c184bdacac Update prepro.js to fix issue with version in main comment. 2015-10-24 09:14:07 +02:00
sapics
89a45a6682 Use cubic equation solution for faster calculation 2015-10-24 14:54:57 +09:00
sapics
294904eac7 Faster curve.getNearestParameter when curve has no handles 2015-10-24 11:39:50 +09:00
Jürg Lehni
c8cc653004 Merge Path#_getOffset() with CurveLocation#getOffset() 2015-10-23 19:57:25 +02:00
Jürg Lehni
e3f065277e Merge pull request #809 from sapics/fix-variable-leaks
Fix variable leak
2015-10-23 07:44:28 +02:00
sapics
502558a321 Fix variable leaks 2015-10-23 09:45:39 +09:00
Jürg Lehni
5be9e1dde5 Remove unused variable. 2015-10-22 15:30:29 +02:00
Jürg Lehni
813ea48932 Remove unused local reference. 2015-10-22 14:46:17 +02:00
Jürg Lehni
85f7134fe6 Reduce curve-time epsilon, and improve comments about other epsilon values. 2015-10-22 10:34:49 +02:00
Jürg Lehni
bafb6794a6 Introduce separate epsilon for fat-line clipping code, and reduce curve-time epsilon. 2015-10-21 23:44:24 +02:00
Jürg Lehni
e9c3e72f60 Simplify handling of winding overlap-adjustment in isValid() 2015-10-21 15:02:53 +02:00
Jürg Lehni
a79212b920 Make handling of points on infinite lines in Line.getSide() more clear. 2015-10-21 10:00:11 +02:00
Jürg Lehni
a9710cf7c0 Fix Line.getSide() call. 2015-10-21 09:35:55 +02:00
Jürg Lehni
0cb792de93 Reverse sign of Line.getSignedDistance()
Closes #789
2015-10-21 09:35:40 +02:00
Jürg Lehni
7c37a4a4d2 Revert "No need for special length handling in propagateWinding()"
This reverts commit 8c702ce5b4.
2015-10-21 09:35:17 +02:00
Jürg Lehni
f8595e93c6 Improve some comments. 2015-10-21 02:45:57 +02:00
Jürg Lehni
169f18617c Address more pending TODOs. 2015-10-21 02:40:12 +02:00
Jürg Lehni
7a95625a13 Remove debug code and TODO from CurveLocation#isCrossing() 2015-10-21 02:36:43 +02:00
Jürg Lehni
8c702ce5b4 No need for special length handling in propagateWinding() 2015-10-21 02:32:56 +02:00
Jürg Lehni
3daa7f78b4 Some comment clean-ups. 2015-10-21 02:24:54 +02:00
Jürg Lehni
341fe1ab4e Remove all boolean debugging and streamline code. 2015-10-21 02:16:17 +02:00
Jürg Lehni
2cf637d13b Merge remote-tracking branch 'origin/boolean-fix' into develop 2015-10-21 01:44:15 +02:00
Jürg Lehni
43cf20096a Implement Curve.getNearestParameter() 2015-10-21 01:43:14 +02:00
Jürg Lehni
8c3d9df06c Further fine-tune the various EPSILON values based on edge-case tests. 2015-10-21 01:42:26 +02:00
Jürg Lehni
5d6b761d3a Introduce separate WINDING_EPSILON and improve GEOMETRIC_EPSILON.
New values are based on a lot of testing.
2015-10-21 01:16:52 +02:00
Jürg Lehni
eb62530958 Improve CurveLocation#equals(). 2015-10-21 01:15:46 +02:00
Jürg Lehni
1f476c2107 Improve CurveLocation#isTouching() to better handle straight lines. 2015-10-21 01:10:24 +02:00
Jürg Lehni
1073340eeb Do not use GEOMETRIC_EPSILON in Curve.getParameterAt()
This caused issues in some rare edge-cases.
2015-10-21 01:09:03 +02:00
Jürg Lehni
d543658c43 Remove old version of Curve#getParameterOf() 2015-10-21 00:17:05 +02:00
Jürg Lehni
140fba56cc Fix Line#isCollinear() and #isOrthogonal() 2015-10-20 23:37:37 +02:00
Jürg Lehni
bcd6520e66 Merge handling of self-intersection crossings with normal crossings.
Shorter code and no additional glitches.
2015-10-20 23:03:40 +02:00
Jürg Lehni
08122131dc Use isOverlap() instead of _overlap everywhere. 2015-10-20 23:02:50 +02:00
Jürg Lehni
6ccd78e8af Go back to simpler code to handle visited segments.
It appears that the imprecisions addressed in 6cdead0e8c have since disappeared.
2015-10-20 23:02:19 +02:00
Jürg Lehni
7422e0710f Some changes to boolean debug logging. 2015-10-20 22:04:30 +02:00
Jürg Lehni
3aa7507ce1 Avoid issues with imprecision in CurveLocation#getCurve() / trySegment() 2015-10-20 22:04:04 +02:00
Jürg Lehni
447feea1da Improve Curve#getParameterOf() to first check curve points with zero epsilon. 2015-10-20 22:03:45 +02:00
Jürg Lehni
60109e897a Use 'preserve' to protect #getPoint() against overriding. 2015-10-20 19:22:33 +02:00
Jürg Lehni
3ae0ca6c94 Remove dependency on curve-time comparisons when comparing locations.
Locations on consecutive short curves (< 1e-7) where unable to merge due to diff > 1.

Relates to #805
2015-10-20 17:53:40 +02:00
Jürg Lehni
7cea3488c0 Remove dependency on curve-time parameter when figuring out which locations to merge. 2015-10-20 17:17:31 +02:00
Jürg Lehni
5dac7e9d29 Reduce maximum recursion again in addCurveIntersections()
32 has lead to many deadlocks.
2015-10-20 16:35:30 +02:00
Jürg Lehni
da43953828 For curves with only one segment, pick the smaller diff between the two locations.
Addresses point 1. in https://github.com/paperjs/paper.js/issues/805#issuecomment-147770300
2015-10-20 16:34:40 +02:00
Jürg Lehni
93e9e54ae5 Make sure we cannot find two intersections between two lines.
Adresses point 2. in https://github.com/paperjs/paper.js/issues/805#issuecomment-148503018
2015-10-20 15:34:09 +02:00
Jürg Lehni
f2cce4c84d Rename variable to be less ambiguous. 2015-10-20 15:21:03 +02:00
Jürg Lehni
63303a59f4 Change PathItem#getIntersections() so that the simply circularity checks in addLocations() work.
This should address the concerns outlined in https://github.com/paperjs/paper.js/issues/805#issuecomment-147850806
2015-10-20 15:18:09 +02:00
Jürg Lehni
e0c31e4a50 Make static getIntersections() methods 'private'. 2015-10-20 10:02:33 +02:00
Jürg Lehni
f1debf401b Streamline overlap handling code. 2015-10-20 10:02:00 +02:00
Jürg Lehni
eb2f7e293a Streamline mouse event handling between View and Item.
Consolidating code and making View#onMouseDown/Up/Move/... events work.
2015-10-17 18:13:00 +02:00
Jürg Lehni
8d1abf7ee2 Merge pull request #806 from sapics/fix-nan-strokebounds
Fix curve evaluate function to finite
2015-10-17 18:11:29 +02:00