Commit graph

6696 commits

Author SHA1 Message Date
Jürg Lehni
2551027d17 Merge pull request #1077 from sapics/fix-leak
Fix variable leak
2016-06-14 12:42:55 +02:00
sapics
a0b868c1ba Fix indentations 2016-06-14 12:26:28 +09:00
sapics
7b91e41131 Fix variable leak 2016-06-14 12:20:58 +09:00
Jürg Lehni
0cb9c50e8f Implement unit test for #1054
Closes #1054
2016-06-13 14:54:13 +02:00
Jürg Lehni
ea5a635edf Implement unit tests for #964
Closes #964.
2016-06-13 14:51:38 +02:00
Jürg Lehni
28543deaf5 Boolean: Handle situations where seg.getNext() can be null.
Closes #1056
2016-06-13 14:17:47 +02:00
Jürg Lehni
742401a0e1 Fix Item#insertChildren() error when passing null for some children.
Relates to #1036
2016-06-13 14:16:25 +02:00
Jürg Lehni
693898a5b1 No more need for two passes of findBestIntersection()
Goodbye strict-mode :)
2016-06-13 12:49:57 +02:00
Jürg Lehni
fbe787dc4d Fix leaked global. 2016-06-13 12:13:42 +02:00
Jürg Lehni
8da82fed19 Mark all segments as visited when processing intersection and subtraction, not just overlaps. 2016-06-13 12:09:17 +02:00
Jürg Lehni
af5a5b5f2d Make findBestIntersection() more strict and improve comments. 2016-06-13 12:08:44 +02:00
Jürg Lehni
94853669f6 Do not complain about open paths if they would not contain an area when closed. 2016-06-13 12:08:04 +02:00
Jürg Lehni
7241edd98a Implement a more refined strategy to handle 'contour' segment in unite boolean operations.
Improvement for the fix in 648beb33e9 for #1054, solves the issues described in https://github.com/paperjs/paper.js/issues/1054#issuecomment-225356983
2016-06-13 11:58:18 +02:00
Jürg Lehni
34c35e26bd Switch to sampling only one location for winding contribution.
Closes #1073
2016-06-13 11:26:02 +02:00
Jürg Lehni
4c94553b81 Minor cleanup. 2016-06-13 09:00:29 +02:00
Jürg Lehni
fc600595a4 Implement improved strategy to handle tangents in CurveLocation#isCrossing()
Relates to #1074
2016-06-13 08:56:45 +02:00
Jürg Lehni
4966f6250f Implement better calculation of tangential angles in CurveLocation#isCrossing()
Relates to #1074
2016-06-12 18:53:14 +02:00
Jürg Lehni
5854c25dd5 Implement Curve#getOffsetAtTime() 2016-06-12 18:32:05 +02:00
Jürg Lehni
b0d0e41ddc Allow negative offsets in all Curve#get*At() methods.
To search from the end of the curve instead of the beginning.
2016-06-12 18:21:37 +02:00
Jürg Lehni
7404485f96 Simplify isInRange() check a bit.
No need to check against ±180 as that condition will always be met.
2016-06-12 17:43:10 +02:00
Jürg Lehni
614c781f29 Put the recursion cap back into fat-line clipping code.
But use a higher value, and have it work in conjunction with call-count cap.
Relates to #1074
2016-06-12 17:07:43 +02:00
Jürg Lehni
452bbfdaa4 Add unit tests and change-log entry for #904
Closes #904
2016-06-11 13:13:08 +02:00
Jürg Lehni
d1f1d7a5f6 Change behavior of PathItem#closePath() to always attempt joining segments.
Add optional tolerance argument, and use it to handle SVG imprecisions.
Closes #1045
2016-06-11 12:43:37 +02:00
Jürg Lehni
de8b626033 Add tolerance argument to Path#join(path, tolerance) 2016-06-11 12:41:23 +02:00
Jürg Lehni
68be3f102e Prevent mousedown events from disturbing mousenter / mouseleave.
Closes #1069
2016-06-11 11:14:19 +02:00
Jürg Lehni
41e4c622a3 Improve fat-line clipping for rare edge cases.
Instead of limiting recursion levels, limit actual call count. Relates to #904
2016-06-10 23:51:56 +02:00
Jürg Lehni
715025725d Improve handling of SymbolItem bounds with #applyMatrix = false.
Closes #1070
2016-06-10 21:32:22 +02:00
Jürg Lehni
ed3e283802 Fix Item#importJSON() to preserve #parent on existing, already inserted items.
Closes #1041
2016-06-10 17:45:02 +02:00
Jürg Lehni
e7f7d7c5d1 Fix jshint error caused by #1065 2016-06-10 17:28:46 +02:00
Jürg Lehni
3e2a3827fd Gulp: Have jshint errors trigger Travis CI failures. 2016-06-10 17:22:11 +02:00
Jürg Lehni
2c2542fb2f Remove unique IDs from Color objects. 2016-06-10 16:19:59 +02:00
Jürg Lehni
0d2779dfc5 Docs: Define default value for PathItem#flatten()
And some other minor cleanups.
2016-06-10 14:53:52 +02:00
Jürg Lehni
964d8cf7d6 PaperScript: Only translate == to equals() calls for Point, Size and Color.
Closes #1043
2016-06-10 13:41:36 +02:00
Jürg Lehni
648beb33e9 Take type of boolean operation into account in getWinding()
Relates to #1054
2016-06-10 13:04:57 +02:00
Jürg Lehni
803dfb6bb1 Improve reliability of Curve#isStraight()
Closes #1066
2016-06-10 12:33:44 +02:00
Jürg Lehni
1f4e4f2f60 Implement boolean simplification suggested by @iconexperiene
See https://github.com/paperjs/paper.js/issues/1054#issuecomment-222517963
2016-06-10 12:06:08 +02:00
Jürg Lehni
83a20b4c11 Implement unit test for #1059.
Closes #1059.
2016-06-10 12:04:08 +02:00
Jürg Lehni
719392dd2c Merge pull request #1060 from iconexperience/patch-3
Check for prevTime >= tMin and prevTime <= tMax
2016-06-10 12:00:23 +02:00
Jürg Lehni
e1961c2b91 Implement unit test and changelog entry for #1064
Closes #1064.
2016-06-10 10:29:38 +02:00
Jürg Lehni
999e8fe4d9 Merge pull request #1065 from iconexperience/patch-1
Fix getInteriorPoint()
2016-06-10 10:24:19 +02:00
Jan
e564955501 Correclty implement sorting of intercepts
`Array.sort()` without comparison function does not sort by numeric value, but by unicode characters (103 comes before 93 by this sorting), therefore a simple comparison function is required.
2016-06-07 16:44:42 +02:00
Jan
b735a3ec95 Fix getInteriorPoint()
getInteriorPoint() could return a point outside the path as explained in #1064
This fix excludes curve's start points from intercept detection to prevent double counting, it ensures that all intercepts are collected and the intercepts are sorted by x-value.
2016-06-07 16:11:37 +02:00
Jan
9f93f6ee78 Check for prevTime >= tMin and prevTime <= tMax
Parameter scaling should only be done if the curve was actually split previously. This only happened if prevTime greater tMin and less tMax.
2016-06-01 14:38:44 +02:00
Jürg Lehni
f19d0c8134 Rename GradientStop#rampPoint to #offset 2016-05-31 12:35:44 +02:00
Jürg Lehni
f07927a95e Correctly handle { x: 0, y: 0 } in Raster#getAverageColor()
Closes #1053
2016-05-27 11:42:08 +02:00
Jürg Lehni
9017bf1767 Unit test: Fix PaperScript left-over in SVG Export. 2016-05-27 11:37:59 +02:00
Jürg Lehni
9aa29e0afc Add support for construction from strings to Point and Size. 2016-05-27 11:37:19 +02:00
Jürg Lehni
fefb4302e8 Improve Item#_getStrokeMatrix() 2016-05-22 21:23:46 +02:00
Jürg Lehni
948a8af9a8 Fix Item#strokeBounds with #strokeScaling and #applyMatrix
Closes #1014
2016-05-22 21:17:24 +02:00
Jürg Lehni
be79a0e504 Cleanup Path#flatten() code. 2016-05-22 17:24:12 +02:00