Commit graph

5397 commits

Author SHA1 Message Date
Jürg Lehni
51ec3325e3 Remove the need to store winding samples in array and sort.
Calculating the average winding value instead yields the same results.
2015-01-03 11:25:10 +01:00
Jürg Lehni
26f209c835 Implement better strategy for handling edge cases in winding samples. 2015-01-03 11:24:27 +01:00
Jürg Lehni
a854c55914 Split off code from Path.Clockwise() into Curve.getEdgeSum() 2015-01-03 01:46:22 +01:00
Jürg Lehni
80e1a54171 Dirty temporary fix for new median winding code that struggles with circles. 2015-01-03 01:17:48 +01:00
Jürg Lehni
5da0ae5c3c Better handle of edge values in Path#split().
Closes #515 & #538
2015-01-03 01:07:51 +01:00
Jürg Lehni
98686ef888 Fix endless recursion in CompoundPath#reduce() 2015-01-03 00:51:06 +01:00
Jürg Lehni
5e654ca64e Reducing an empty CompoundPath should replace it with an empty Path. 2015-01-03 00:46:45 +01:00
Jürg Lehni
e195db2567 Handle empty paths in Path#reorient()
Closes #548
2015-01-03 00:46:24 +01:00
Jürg Lehni
001561decb Remove the dependency of Math.random() from boolean operation code.
Closes #473
2015-01-03 00:32:06 +01:00
Jürg Lehni
bb2fece225 Restructure code that determines median winding contribution. 2015-01-03 00:26:13 +01:00
Jürg Lehni
5f0e545ba7 Use EPSILON instead of TOLERANCE in Point#isColinear() and #isOrthogonal() 2015-01-02 23:48:34 +01:00
Jürg Lehni
538eac6dc7 Use smaller tolerances in winding code, to address edge cases.
Closes #559
2015-01-02 23:47:26 +01:00
Jürg Lehni
6359738618 Do not offset bounds in cubic solver by MACHINE_EPSILON, as this is how comparisons are performed with values offset by tolerances elsewhere in the library.
Doing it differently here produced various errors in fat-line clipping and boolean code.
2015-01-02 23:14:19 +01:00
Jürg Lehni
f0fdb804ec Reduce value of EPSILON to the lowest amount that does not cause issues in boolean-test. 2015-01-02 22:37:36 +01:00
Jürg Lehni
477527f8ec Implement more intuitive version of clipConvexHull(), outlined in #570 by @iconexperience
Code further shortened using a sub-routine.
2015-01-02 22:36:04 +01:00
Jürg Lehni
232739fae9 Add comments to fat-line clipping code linking to issues #568 and #571. 2015-01-02 22:34:09 +01:00
Jürg Lehni
cdfd21ddd3 Switch to using new cubic solver by @hkrish 2015-01-02 21:44:29 +01:00
Jürg Lehni
8ad067ec6c Use tolerance when comparing curve locations by parameter. 2015-01-02 21:20:28 +01:00
Jürg Lehni
4ed9ef54f2 Fix bug in Curve.filterIntersections() and clean up code a bit. 2015-01-02 21:19:18 +01:00
Jürg Lehni
b2261fd512 Introduce Curve.filterIntersections() and use it both in PathItems#getIntersections() and Curve#getIntersections() 2015-01-02 21:00:05 +01:00
Jürg Lehni
3302a7dff5 Increase recursion threshold to 4 when checking for fatline convergence. 2015-01-02 20:49:09 +01:00
Jürg Lehni
fbd026ea0d Bring back code removed by @hkrish in commit 5fb75593c2
Relates to issue #570, still required to figure out why it is still needed.
2015-01-02 20:02:45 +01:00
Jürg Lehni
e3e3d13fa5 Add comment regarding issue #565 2015-01-02 16:33:15 +01:00
Jürg Lehni
b75def3f3a Implement optimal values in fat line clipping code for maximum recursion and curve time difference, as determined by @iconexperience.
Closes #565
2015-01-02 16:29:12 +01:00
Jürg Lehni
45c86a3035 Switch to suggested new implementation of Line.getSignedDistance() by @iconexperience
Closes #554
2015-01-02 16:17:19 +01:00
Jürg Lehni
8ae8855b81 Visually center JSON tiger example. 2015-01-02 14:39:13 +01:00
Jürg Lehni
95a8539045 Fix size issue on non-resizable HiDPI canvases.
Reverting back to original behavior in #586.
2015-01-02 14:38:06 +01:00
Jürg Lehni
3c31c0e482 Have SVGImport respect the current PaperScope's applyMatrix setting. 2015-01-02 14:19:17 +01:00
Jürg Lehni
54d959df1f Load CSS in all examples. 2014-12-30 00:29:20 +01:00
Jürg Lehni
a07dc98046 Clean up and simplify code from pull request #580 and fix CSS in examples accordingly. 2014-12-30 00:16:51 +01:00
Jürg Lehni
ac9c3f03c4 Merge branch 'georeith-true-resize-canvas' 2014-12-30 00:14:58 +01:00
Jürg Lehni
5b9eb4bd1a Revert unecessarily commited files in pull request #586 2014-12-30 00:14:33 +01:00
Jürg Lehni
dfda6cf7b5 Merge branch 'true-resize-canvas' of https://github.com/georeith/paper.js into georeith-true-resize-canvas 2014-12-29 23:56:57 +01:00
Jürg Lehni
66c67fbe94 Improve insertion handling for Item and Layer so insertAbove() / insertBelow() works for Layers too.
Closes #603
2014-12-29 23:16:13 +01:00
Jürg Lehni
83dd2034c3 Fix issue where cloned TextItems get always inserted into the scene graph.
Closes #606
2014-12-28 19:43:38 +01:00
Jürg Lehni
16105067bf Correctly handle Item#insertChild(null) 2014-12-28 18:29:20 +01:00
Jürg Lehni
a307bc4d14 Implement recursively parameter in Matrix#apply(), so matrices can be backed in recursively in children too. 2014-12-28 18:29:04 +01:00
Jürg Lehni
80e64ad0a9 Implement setters for Raster#width and #height, and properly handle these values being set in constructors, along with #size.
Closes #557.
2014-12-28 18:27:32 +01:00
Jürg Lehni
5890de3a80 Some more clean-up in unit test helpers code. 2014-12-28 18:23:04 +01:00
Jürg Lehni
644fb71dc1 Implement unit test comparator for Item & co + Project, and further improve new comparator code. 2014-12-28 18:10:53 +01:00
Jürg Lehni
1de750bc77 Check for Path#closed in Path#equals() 2014-12-28 18:10:14 +01:00
Jürg Lehni
7bc6da5401 Do not create entries in Style#_values for default values. 2014-12-28 18:03:41 +01:00
Jürg Lehni
fb890b2c8a Implement Symbol#equals() 2014-12-28 18:03:19 +01:00
Jürg Lehni
9adbc3774a Implement unit test comparators for many more types, and start refactoring compareItems() helper. 2014-12-28 16:41:23 +01:00
Jürg Lehni
c5a2a51f3e Implement unit test comparator for Color and improve new comparator code. 2014-12-28 15:21:38 +01:00
Jürg Lehni
b8674a3bc1 Implement unit test comparators for Point, Size and Rectangle. 2014-12-28 14:59:48 +01:00
Jürg Lehni
92521d0ac8 Check expected value first for class to be used to perform comparison, since actual value might be wrong. 2014-12-28 14:36:09 +01:00
Jürg Lehni
e95e17826e Start cleaning up unit tests by introducing new class/type-based comparators lookup table. 2014-12-28 14:33:22 +01:00
Jürg Lehni
28538d8a43 Clean up code from #597 a bit. 2014-12-26 06:42:46 +01:00
Jürg Lehni
71e2af9d70 Merge pull request #597 from byte-foundry/simplify_closed
fix #572 Handle closed path in PathFitter
2014-12-26 06:30:56 +01:00