Jürg Lehni
8c09d19f7c
Fix wrong calculation of rough bounds for square caps.
...
And add some comments to stroke hit-testing code.
2013-06-15 05:15:48 -07:00
Jürg Lehni
26971672b2
Only check segments for miters that are within the limit.
2013-06-15 05:08:12 -07:00
Jürg Lehni
be1098e006
Further improve stroke hit-testing.
...
Properly detect all miter joins.
2013-06-15 05:06:09 -07:00
Jürg Lehni
d318057897
Implement Segment#getLocation()
2013-06-15 05:05:10 -07:00
Jürg Lehni
1cab9aad90
Improve stroke hit-testing.
2013-06-15 03:12:57 -07:00
Jürg Lehni
eb32bad57e
Fix imprecision in #getNearestLocation()
2013-06-15 03:12:29 -07:00
Jürg Lehni
38f832a888
Remove console.log()
2013-06-15 02:25:44 -07:00
Jürg Lehni
8b9fb3741d
Implement proper stroke hit-testing for all variations of joins and caps.
2013-06-15 02:24:59 -07:00
Jürg Lehni
e4ba0d80b6
Simple code improvement in #isClockwise().
2013-06-14 23:18:29 -07:00
Jürg Lehni
4ffcdc3971
Clean up code.
2013-06-14 23:13:54 -07:00
Jürg Lehni
1ae7832ab3
Move calculation of square joins and caps to static methods.
...
These will be of use when correctly implementing hit-testing of strokes.
2013-06-14 23:11:50 -07:00
Jürg Lehni
ca0e931498
Clean up and simplify getStrokeBounds() code.
...
Handling of bevel and miter joins can be merged nicely.
2013-06-14 22:57:14 -07:00
Jürg Lehni
1dee05900f
Move getArea code to other statics block.
2013-06-13 23:16:44 -07:00
Jürg Lehni
610e396d94
Make Curve#_getCrossings() a static method and have it work on curve values directly.
2013-06-13 23:16:00 -07:00
Jürg Lehni
01e48b3322
Improve and clean up fat-line bug fix.
2013-06-13 15:53:28 -07:00
Jürg Lehni
38f31be6b2
Clean up and simplify Path#_hitTest() code.
2013-06-13 14:30:52 -07:00
Jürg Lehni
95ecab8a6f
Improve handling of merged CompoundPath style through #getStyle().
...
Only access _style directly in core code if you really know what you're doing!
2013-06-12 20:12:08 -07:00
Jürg Lehni
33eb750586
Simplify Path#hasFill() and implement #hasStroke() as well.
2013-06-12 19:57:05 -07:00
Jürg Lehni
2196ef2a74
Streamline various #equals() methods.
2013-06-12 18:57:12 -07:00
Jürg Lehni
6fe60cff9d
Fix trailing comas.
2013-06-12 17:42:38 -07:00
Jürg Lehni
cb0dcf1719
Fix accidental global leakage.
2013-06-12 17:27:20 -07:00
Jürg Lehni
d1932124d7
Implement #equals() in Point, Size and Rectangle without argument reading.
...
Closes #235
2013-06-12 15:28:29 -07:00
Jürg Lehni
7a2f577b75
Implement Path#contains() correctly for open paths.
2013-06-12 00:35:34 -07:00
Jürg Lehni
f45a66d2ee
Filter out curves with zero length in Path#contains() algorithm.
...
Fixes #227
2013-06-12 00:19:54 -07:00
Jürg Lehni
20f7c567aa
Use Base objects for drawing params, so we can use param.extend() on them for easier overriding.
2013-06-11 20:40:44 -07:00
Jürg Lehni
ce7d584c05
Revert readNull and clone parameter sequence in arguments reading code.
2013-06-11 19:49:35 -07:00
Jürg Lehni
18383875eb
Fix global variable leakage.
2013-06-11 17:46:50 -07:00
Jürg Lehni
375156059d
Do not use pathData in JSON for CompoundPaths.
2013-06-11 15:27:04 -07:00
Jürg Lehni
03a7503789
Fix issue in getPathData() with closed CompoundPaths.
2013-06-11 15:26:44 -07:00
Jürg Lehni
7faf2a9e70
Clean-up @hkrish's changes a bit.
2013-06-09 18:37:08 -07:00
hkrish
d8498b6418
Remove invalid code and unnecessary comments
2013-06-09 22:02:50 +05:30
hkrish
d3405115c1
Use parameter on both curves in CurveLocation objects instead of Point in #getIntersection()
2013-06-08 21:37:43 +05:30
hkrish
cdaab794f2
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js : (56 commits)
Fix regressions in Raster caused by faulty merge.
Store data in _data rather than on the image itself.
Clean up @trankek's fix for node a bit.
Explain compact = true in Project#_serialize()
Properly fix issue with Project#exportJSON() creating separate projects on import.
Update straps.js to version 1.1.0
Rename options.server to options.node
Remove all create() constructors for basic types since new constructors are now faster.
Make sure project we import into is active.
Unbox project data in Project#importJSON(), as we don't want to create a new project object.
Remove need for _needsRedraw() calls by replacing it with a boolean flag.
Apply "pending" matrix in group when it receives content.
Move main Item insertion code from #insertChild() to #insertChildren().
Fix documentation warning.
Handle exporting of Numerical and PaperScript in export.js
Update straps.js to latest version.
Accessors cannot define the writable property.
Properly export Numerical and PaperScript again.
Only reset matrices in Groups when it could actually be applied to the content.
Set options.stats = false for build.sh and Node.js
...
2013-05-29 19:09:07 +02:00
Jürg Lehni
dd38e4aae6
Merge pull request #231 from NorthNick/master
...
Path.arcBy bug fix
2013-05-28 07:53:58 -07:00
Jürg Lehni
cd7db56249
Remove all create() constructors for basic types since new constructors are now faster.
...
Woop!
2013-05-27 23:57:31 -07:00
Jürg Lehni
9b0d32651f
Move main Item insertion code from #insertChild() to #insertChildren().
...
Handles insertion and change notification much more efficiently.
2013-05-27 20:06:30 -07:00
Jürg Lehni
5592bb57e0
Properly export Numerical and PaperScript again.
2013-05-27 15:55:44 -07:00
Jürg Lehni
10d5de3ed6
Implement a better way to name and export class constructors.
...
This change also simplified the way classes are exported to PaperScope objects.
2013-05-27 12:48:58 -07:00
Jürg Lehni
c533dda7b5
Finally found a better and faster alternative for this.base() calls, by setting base on the function object instead.
...
base can be accessed on named functions very easily, leading to another measurable speed increase. Finally all performance reasons against straps.js are eliminated!
2013-05-27 10:04:05 -07:00
Jürg Lehni
369b329b23
Change straps.js to directly use initialize() as constructor function rather than redirecting calls to it.
...
Should yield some interesting performance improvements.
2013-05-27 09:11:50 -07:00
Jürg Lehni
f9267e7f5c
Some more code clean up and variable renaming.
2013-05-26 17:59:01 -07:00
Jürg Lehni
14962b5c45
Clean up code a bit more.
2013-05-26 17:52:05 -07:00
Jürg Lehni
32709a176b
Fix some comments.
2013-05-26 17:48:36 -07:00
Jürg Lehni
7050edd6e4
Fix point sequence.
2013-05-26 17:40:40 -07:00
Jürg Lehni
90f0679700
Further simplify getConvexHull() by using p0 … p3 point objects.
2013-05-26 17:39:13 -07:00
Jürg Lehni
487c4c4aef
Further simplify getConvexHull() by inlining cross product calculations.
2013-05-26 17:32:44 -07:00
Jürg Lehni
9edab9c3aa
Simplify convex hull algorithm by returning lists of points rather than lines.
...
We can avoid some data redundancy that way at no performance cost.
2013-05-26 17:18:54 -07:00
Jürg Lehni
9540b7f6a9
Use addLineIntersection() in subdivision algorithm as well.
2013-05-26 17:10:29 -07:00
Jürg Lehni
20737c6664
Rename various intersection methods.
2013-05-26 17:06:23 -07:00
Jürg Lehni
5d7cc2fb40
Use new Line.getSignedDistance().
2013-05-26 16:58:49 -07:00
Jürg Lehni
80f9f6061c
Change the way the Line class handles direction vectors and infinite lines.
...
The beginning of performance improvements in the Line class.
2013-05-26 15:44:52 -07:00
NickNorth
3e520efe5f
arcBy recursively calls itself rather than arcTo.
2013-05-26 20:09:26 +01:00
Jürg Lehni
1fb0a3a13c
Always provide t parameter for CurveLocations if we know it.
2013-05-25 11:23:59 -07:00
hkrish
46a324722a
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js : (90 commits)
Start merging fat-line clipping code into Curve class.
Fix white-spaces.
Merge handling of flat curves.
More getConvexHull() clean up.
Remove unused variable dqmin.
Further clean up clipFatLine()
Some clean up in clipFatLine()
Merge the two convergence checks to one.
Simplify convergence checks.
Rename p\d to part\d
Rename v\dt to range\d
Simplify handling of ranges and curve parts.
Switch to using arrays rather than objects for parameter ranges.
Reverse logic of v1t / _v1t naming and switch to using Numerical constants.
Re-implement Curve.getLocation2() as "hub" for all the different intersection methods.
Use break; instead of return; and untangle unnecessarily nested conditionals.
Define private addLocation() to reduce code redundancy.
Correctly handle calculation of CurveLocation point in getCurveIntersections().
Move Curve.getIntersection2 to private function and better name other private functions.
Always use parameter in getCurveLineIntersection() by flipping curve1 / 2 values as well.
...
2013-05-25 11:37:33 +02:00
Jürg Lehni
502c76dbce
Start merging fat-line clipping code into Curve class.
...
And add a prepro option for now.
2013-05-24 22:30:13 -07:00
Jürg Lehni
7f00ef8f05
Fix white-spaces.
2013-05-24 22:25:22 -07:00
Jürg Lehni
7e5f846190
Remove debugging code.
2013-05-24 17:57:13 -07:00
Jürg Lehni
bd3ac02bbe
Use Curve instead of this.
...
Compresses better and allows passing on function as callback.
2013-05-24 17:52:05 -07:00
hkrish
cfbe6d8312
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js :
Remove Item#applyMatrix boolean, go back to previous way of directly applying transformations to children in Group and Layer, and introduce new Clip class for non-transformed nested matrices.
Make sure the Base class is exposed in Node.js
2013-05-16 20:33:13 +02:00
Jürg Lehni
7c2e57e105
Remove Item#applyMatrix boolean, go back to previous way of directly applying transformations to children in Group and Layer, and introduce new Clip class for non-transformed nested matrices.
2013-05-13 18:57:17 -07:00
hkrish
158001c154
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js :
Fix: #initialize() to correctly convert #getValue() array back to Curve object.
Handle allowNull correctly again in SVGImport.
Simplify SVGImport attribute parsing and correctly handle failing tests with invalid coordinates.
Further refine Node.js integration.
Improve the Node version of Base.isPlainObject()
2013-05-11 14:42:56 +02:00
Harikrishnan Gopalakrishnan
ce600f4ea4
Fix: #initialize() to correctly convert #getValue() array back to Curve object.
2013-05-11 00:59:30 +03:00
hkrish
fce29e4b75
merge upstream
2013-05-09 14:30:28 +02:00
Jürg Lehni
7b8e27ddd9
Further simplify getNearestPoint() algorithm.
2013-05-07 00:07:18 -07:00
Jürg Lehni
d70c9b0464
Minor syntax fixes.
2013-05-05 23:19:22 -07:00
Jürg Lehni
3a7547a255
Bring back accidentally removed static functions on Curve.
2013-05-05 23:14:49 -07:00
Jürg Lehni
db42dfdfc1
Implement simpler strategy to iteratively find nearest points on paths.
...
Idea based on method described on http://pomax.github.io/bezierinfo/
2013-05-05 23:05:57 -07:00
Jürg Lehni
acb3d6f5f9
Update package.json for publishing to NPM.
2013-05-05 19:22:13 -07:00
Jürg Lehni
0fc4b9f28d
Remove intersection caching code.
2013-05-05 16:38:18 -07:00
Jürg Lehni
83b68cdb8e
Restore full validation check for resulting paths.
2013-05-05 16:36:25 -07:00
Jürg Lehni
c006b081f6
Fix issue that broke "Maximum possible intersections between 2 cubic bezier curve segments - 9" test.
2013-05-05 16:23:41 -07:00
Jürg Lehni
364f6dcd36
Improve code comments a bit.
2013-05-04 11:13:38 -07:00
Jürg Lehni
6da97b894f
Improve code comments a bit.
2013-05-04 11:13:38 -07:00
Jürg Lehni
656300ffb1
Write documentation for boolean path operations.
2013-05-04 10:58:50 -07:00
Jürg Lehni
d911c7b12a
Write documentation for boolean path operations.
2013-05-04 10:58:50 -07:00
Jürg Lehni
26b3beed5c
Implement static Line.intersect() and use it to speed up Curve.getIntersections()
...
Unfortunately doesn't seem to have any impact!
2013-05-04 10:22:10 -07:00
Jürg Lehni
f704b00e00
Implement static Line.intersect() and use it to speed up Curve.getIntersections()
...
Unfortunately doesn't seem to have any impact!
2013-05-04 10:22:10 -07:00
Jürg Lehni
86a26db2a2
Use variable names that better reflec functionality and original naming.
2013-05-04 09:58:46 -07:00
Jürg Lehni
4eff5bf45e
Use variable names that better reflec functionality and original naming.
2013-05-04 09:58:46 -07:00
Jürg Lehni
f58f58e406
Some more minor tweaks.
2013-05-04 03:38:19 -07:00
Jürg Lehni
3ab20ea3e9
Some more minor tweaks.
2013-05-04 03:38:19 -07:00
Jürg Lehni
023f768817
Further clean up.
...
Instead of removing temporary data structure, clone Segment.
2013-05-04 03:33:44 -07:00
Jürg Lehni
1e8947af63
Further clean up.
...
Instead of removing temporary data structure, clone Segment.
2013-05-04 03:33:44 -07:00
Jürg Lehni
cb66f6f2e2
Improve comments.
2013-05-04 03:20:53 -07:00
Jürg Lehni
31a45bad97
Improve comments.
2013-05-04 03:20:53 -07:00
Jürg Lehni
cbde2ea526
Fix accidental variable leakage.
2013-05-04 03:13:57 -07:00
Jürg Lehni
e1ef69f23a
Fix accidental variable leakage.
2013-05-04 03:13:57 -07:00
Jürg Lehni
b5abfcb515
One last optimization in computeBoolean().
2013-05-04 03:08:43 -07:00
Jürg Lehni
469d3129a6
One last optimization in computeBoolean().
2013-05-04 03:08:43 -07:00
Jürg Lehni
3ee10c1765
more optimizations in computeBoolean().
...
I think this is done now!
2013-05-04 03:00:31 -07:00
Jürg Lehni
7fdaa3e699
more optimizations in computeBoolean().
...
I think this is done now!
2013-05-04 03:00:31 -07:00
Jürg Lehni
9fb7340aac
Remove need for __segment property and further simplify computeBoolean() code.
2013-05-04 02:50:18 -07:00
Jürg Lehni
9aafb46e6c
Remove need for __segment property and further simplify computeBoolean() code.
2013-05-04 02:50:18 -07:00
Jürg Lehni
43b7afb961
Merge loops in reorientPath().
2013-05-03 23:25:26 -07:00
Jürg Lehni
a5d00e64cf
Merge loops in reorientPath().
2013-05-03 23:25:26 -07:00
Jürg Lehni
aab41752b4
Minor cleanup.
2013-05-03 23:08:00 -07:00
Jürg Lehni
37300455a8
Minor cleanup.
2013-05-03 23:08:00 -07:00
Jürg Lehni
737c2c36fe
More computeBoolean() optimizations and clean up.
2013-05-03 23:03:00 -07:00
Jürg Lehni
4a9e3924c6
More computeBoolean() optimizations and clean up.
2013-05-03 23:03:00 -07:00
Jürg Lehni
55c799dc2c
Clean up computeBoolean().
...
Work in progress.
2013-05-03 22:38:29 -07:00
Jürg Lehni
1031f4ecfb
Clean up computeBoolean().
...
Work in progress.
2013-05-03 22:38:29 -07:00
Jürg Lehni
f15deec334
Clean up reorientCompoundPath().
2013-05-03 22:09:56 -07:00
Jürg Lehni
d014ed3c68
Clean up reorientCompoundPath().
2013-05-03 22:09:56 -07:00
Jürg Lehni
d5543842e9
Define CompoundPath#reverse() and #clockwise, and replace reversePath() with it.
2013-05-03 21:41:22 -07:00
Jürg Lehni
25e5582a35
Define CompoundPath#reverse() and #clockwise, and replace reversePath() with it.
2013-05-03 21:41:22 -07:00
Jürg Lehni
3515574f65
Move fix for faulty _curves list after calls to Path#reverse() to the right place.
2013-05-03 21:33:17 -07:00
Jürg Lehni
bd3031cdff
Move fix for faulty _curves list after calls to Path#reverse() to the right place.
2013-05-03 21:33:17 -07:00
Jürg Lehni
81b4136775
Improve testOnCurve() code.
2013-05-03 21:24:02 -07:00
Jürg Lehni
f03283804b
Improve testOnCurve() code.
2013-05-03 21:24:02 -07:00
Jürg Lehni
98efa2f66b
Move private functions into private injection scope.
2013-05-03 21:21:53 -07:00
Jürg Lehni
99cf8ae9d4
Move private functions into private injection scope.
2013-05-03 21:21:53 -07:00
Jürg Lehni
d268c68ae5
Remove names from boolean operator functions and use parameter instead.
2013-05-03 21:16:36 -07:00
Jürg Lehni
990e8b4599
Remove names from boolean operator functions and use parameter instead.
2013-05-03 21:16:36 -07:00
Jürg Lehni
9a4c8bde19
Rewrite PathItem#_splitPath() to use Curve#divide().
...
Leading to faster code, due to less loop passes.
2013-05-03 21:05:44 -07:00
Jürg Lehni
fb8effe088
Rewrite PathItem#_splitPath() to use Curve#divide().
...
Leading to faster code, due to less loop passes.
2013-05-03 21:05:44 -07:00
Jürg Lehni
7e6519349a
Clean up Curve#divide() code.
2013-05-03 21:00:46 -07:00
Jürg Lehni
85de8a0b7d
Clean up Curve#divide() code.
2013-05-03 21:00:46 -07:00
Jürg Lehni
5f0feeb31f
Adjust precision of Curve#isFlatEnough() to cover rare edge cases.
2013-05-03 21:00:37 -07:00
Jürg Lehni
3101989974
Adjust precision of Curve#isFlatEnough() to cover rare edge cases.
2013-05-03 21:00:37 -07:00
Jürg Lehni
b07e52d361
More work on PathItem#__splitPath()
2013-05-03 18:52:03 -07:00
Jürg Lehni
af51edda34
More work on PathItem#__splitPath()
2013-05-03 18:52:03 -07:00
Jürg Lehni
f054f4a7e0
Allow better code compression by reducing property lookup.
2013-05-03 17:38:15 -07:00
Jürg Lehni
af84bb9988
Allow better code compression by reducing property lookup.
2013-05-03 17:38:15 -07:00
Jürg Lehni
8f7de47bb9
Clean up and simplify PathItem#_splitPath() code.
...
- Follow Paper.js variable scoping conventions (pretend we have Java-style variable scopes for better readability of code)
- Break lines at 80 chars
- Merge some duplicate code in segment handling.
2013-05-03 17:30:59 -07:00
Jürg Lehni
72a27d9732
Clean up and simplify PathItem#_splitPath() code.
...
- Follow Paper.js variable scoping conventions (pretend we have Java-style variable scopes for better readability of code)
- Break lines at 80 chars
- Merge some duplicate code in segment handling.
2013-05-03 17:30:59 -07:00
Jürg Lehni
410ceb8ff1
Simplify PathItem#exclude() and #divide()
2013-05-03 16:56:00 -07:00
Jürg Lehni
b8fcc9b105
Simplify PathItem#exclude() and #divide()
2013-05-03 16:56:00 -07:00
Jürg Lehni
1d55372ed4
Revert return strategy of boolean operators for simpler code, simplify operator logic and inline functions.
2013-05-03 16:52:37 -07:00
Jürg Lehni
c11967c81c
Revert return strategy of boolean operators for simpler code, simplify operator logic and inline functions.
2013-05-03 16:52:37 -07:00
Jürg Lehni
3fc200973e
Include BooleanOperations.html
2013-05-03 16:31:36 -07:00
Jürg Lehni
ee8a79449b
Include BooleanOperations.html
2013-05-03 16:31:36 -07:00
Jürg Lehni
68d67fcdcf
Start converting boolean code to Paper.js conventions.
...
- Tabs instead of white-space
- Different rules about spaces before / after parenthesis
2013-05-03 16:21:44 -07:00
Jürg Lehni
1fe83a482f
Start converting boolean code to Paper.js conventions.
...
- Tabs instead of white-space
- Different rules about spaces before / after parenthesis
2013-05-03 16:21:44 -07:00
Jürg Lehni
7ec53f74d1
Move boolean code into its own file, and add information comments again.
2013-05-03 16:16:52 -07:00
Jürg Lehni
90e3dd201a
Move boolean code into its own file, and add information comments again.
2013-05-03 16:16:52 -07:00
hkrish
d9d86f4ff7
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js :
Undo recent change to Curve#getIntersection() since it breaks some boolean operations.
ý5:q
2013-05-03 19:24:03 +02:00
hkrish
e75cc32a3b
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js :
Undo recent change to Curve#getIntersection() since it breaks some boolean operations.
ý5:q
2013-05-03 19:24:03 +02:00
Jürg Lehni
9e3b7eef50
Undo recent change to Curve#getIntersection() since it breaks some boolean operations.
2013-05-02 11:32:24 -07:00
Jürg Lehni
840e879ba8
Undo recent change to Curve#getIntersection() since it breaks some boolean operations.
2013-05-02 11:32:24 -07:00
hkrish
debce28bc4
Merge upstream
2013-05-02 14:18:24 +02:00
hkrish
10553c1bd8
Merge upstream
2013-05-02 14:18:24 +02:00
hkrish
381ee98cbc
Updated boolean operation methods.
...
The algorithm is based on paperjs' native segment and curve objects
rather than the generic Node and Link objects.
Also this is much smaller and faster! :)
2013-05-02 13:49:07 +02:00
hkrish
73b018f006
Updated boolean operation methods.
...
The algorithm is based on paperjs' native segment and curve objects
rather than the generic Node and Link objects.
Also this is much smaller and faster! :)
2013-05-02 13:49:07 +02:00
Jürg Lehni
f425c931a8
Improve Curve#getIntersections() by avoiding further subdivision of flat curves.
2013-05-01 18:40:57 -07:00
Jürg Lehni
e8fed1bdf0
Improve Curve#getIntersections() by avoiding further subdivision of flat curves.
2013-05-01 18:40:57 -07:00
Jürg Lehni
023c8b0432
Fix issue with recursive call of Curve.getIntersections().
2013-05-01 18:24:54 -07:00
Jürg Lehni
c61e8d57b9
Fix issue with recursive call of Curve.getIntersections().
2013-05-01 18:24:54 -07:00
hkrish
934ec8df7e
Fix: Update the getIntersections method signature in recursive calls
2013-05-01 13:29:02 +02:00
hkrish
f239a3980d
Fix: Update the getIntersections method signature in recursive calls
2013-05-01 13:29:02 +02:00
hkrish
d8dc762826
Merge branch 'master' of https://github.com/paperjs/paper.js
...
* 'master' of https://github.com/paperjs/paper.js :
Define CurveLocation#intersection as a way to retrieve the CurveLocation on the intersecting path when using Path#getIntersections().
ý5ý`qkb:q
2013-05-01 12:39:04 +02:00