hkrish
aea9a5cd6c
Minor Fixes
2014-01-26 05:39:51 +01:00
hkrish
758cf67f6e
Move sorting and expansion of intersections to the getIntersections method
2014-01-26 05:39:00 +01:00
hkrish
c5ddbf19da
Remove duplicate intersections in #getIntersections
2014-01-26 05:38:09 +01:00
hkrish
cf9aec9233
Remove addLocation helper. We have to remove duplicates once we have all the intersections.
2014-01-25 23:50:29 +01:00
hkrish
24cbf3b079
Correct winding contribution calculation for horizontal curves
2014-01-16 20:02:26 +01:00
Jürg Lehni
706fe2c77d
Rearrange Base.read argument sequence.
...
options are used more often than length.
2014-01-05 18:31:24 +01:00
Jürg Lehni
cd6bfa0b77
Move Curve#getLength(from, to) to Curve#getPartLength(from, to).
...
Clears up the Curve#getLength() getter and removes the need for accessing arguments[]
2014-01-05 18:06:45 +01:00
Jürg Lehni
e3f3a9c9d2
Merge branch 'refs/heads/master' into v8-optimizations
2014-01-05 17:42:59 +01:00
Jürg Lehni
1ee5b2c126
Fix references to Bootstrap.js in comments.
2014-01-05 17:41:38 +01:00
Jürg Lehni
6cb25fafe3
Use changes in latest Straps.js to remove as many hidden parameters as possible.
...
Hidden parameters through arguments[] are bad news for JS optimizer engines.
2014-01-05 17:40:54 +01:00
hkrish
df7e8e43b2
More explanation and indentation fixes
2014-01-05 15:59:21 +01:00
hkrish
bcdec37b1a
Do a much simpler but thorough check for winding contribution, instead of trying to be clever :)
2014-01-05 14:38:15 +01:00
Jürg Lehni
ea63d4c288
Merge branch 'refs/heads/master' into v8-optimizations
...
Conflicts:
src/core/Base.js
src/style/Color.js
2014-01-05 05:01:13 +01:00
Jürg Lehni
e22fa3a664
Update copyright notice.
2014-01-04 01:47:16 +01:00
Jürg Lehni
6a11547942
Fix issue in Curve.getLength() for linear curves with sub-ranges.
...
Closes #376 .
2013-12-30 14:20:05 +01:00
Jürg Lehni
35890383d8
Merge branch 'refs/heads/paperscript-refactoring' into v8-optimizations
2013-12-29 15:54:54 +01:00
Jürg Lehni
8395541298
Clean up docs and fix spelling mistakes.
2013-12-29 15:44:26 +01:00
hkrish
f2168b48cb
new Boolean operator functions
2013-12-29 13:40:22 +01:00
hkrish
3b85d3d990
Remove TestOnCurve method
2013-12-29 13:38:33 +01:00
hkrish
9831720c9c
New computeBooleean method
2013-12-29 13:38:04 +01:00
hkrish
7af091ca5b
Dont alter the winding direction for paths within compoundPaths if they are not completely contained
2013-12-29 13:36:43 +01:00
hkrish
d02e0dcecf
Remove old SplitPath method
2013-12-29 13:32:12 +01:00
hkrish
3f6562d5b3
Method for tracing a set of connected segments and producing paths; used in boolean ops and path offsetting methods.
2013-12-29 13:29:54 +01:00
hkrish
7c75dcee97
New Split path method
2013-12-29 13:25:48 +01:00
hkrish
1be669396e
First cut at a new winding number calculation algorithm
2013-12-29 13:21:08 +01:00
hkrish
a88d7f5eae
Rudimentary self-intersection calculation
2013-12-29 13:06:25 +01:00
hkrish
1bacbc32e9
Link previous & next curves while returning monotone curves
2013-12-29 13:03:39 +01:00
hkrish
0b4da28c1e
Optimize handling of horizontal curves in Curve#_getWinding
2013-12-29 12:38:59 +01:00
Jürg Lehni
c0ed227cbc
Add sorted argument to PathItem#getIntersections()
2013-12-28 21:06:35 +01:00
Jürg Lehni
58bd3aa444
Sorting CurveLocation by path index produces the correct sequence in compound paths too.
2013-12-28 21:01:44 +01:00
Jürg Lehni
38d67d843d
Move Path#getStyle() to better location and simplify code.
2013-12-28 20:56:44 +01:00
Jürg Lehni
451ff4fd03
Docs: Add group title to boolean path operations.
2013-12-28 20:56:30 +01:00
hkrish
a8a4a6fd03
Return horizontal curves as well, with monotonic curves
2013-12-26 18:03:23 +01:00
hkrish
4562b104f2
Winding number calculation for a given point
2013-12-25 20:46:13 +01:00
hkrish
39c52f326e
New _getWinding method in Curve. This method return the winding contribution of this curve w.r.t. the resulting PathItem
2013-12-25 20:41:19 +01:00
hkrish
0134596f66
_getMonotoneCurves method which returns and caches curves that are monotonic in Y direction
2013-12-25 20:38:48 +01:00
hkrish
b4c7bcae5e
Indent with Tabs like rest of paperjs code.
2013-12-25 20:33:51 +01:00
hkrish
70070c14d2
Avoid creating proxy array objects
2013-12-24 19:00:33 +01:00
hkrish
f23303e371
Merge branch 'master' into bool-new
...
* master:
Share code that handles bounds in roots between solveQuadratic() and solveCubic()
Inline EPSILON and TOLERANCE for better performance in Numerical.
Clean up code a bit.
Filter out insert property in Item#set()
Typo Paelette -> Palette
Rename Item#anchor -> Item#pivot
Minor documentation fixes.
2013-12-24 00:02:15 +01:00
hkrish
3b013c0720
Add an optional ignoreLinear parameter to Curve#divide, so that new segments on linear curves will keep their correct bezier handles.
2013-12-23 23:38:12 +01:00
hkrish
20b6d699db
Consistently return curve parameter on Line intersections as well, so that sorting intersections wouldn't fail.
2013-12-23 23:34:26 +01:00
hkrish
20fbdcffda
Subdivide only if tDiff on both curves have failed to converge more than 80%
2013-12-23 23:27:23 +01:00
Jürg Lehni
81651a7379
Prevent V8 "assignment to parameter in arguments object" deoptimizations.
...
Some getter-like functions still need fixing, but this might require a fix in Straps.js first.
2013-12-17 23:28:55 +01:00
Jürg Lehni
3dbad9c477
Replace delete in favor of setting to undefined to prevent V8 deoptimization.
2013-12-17 23:27:48 +01:00
Jürg Lehni
99d7b5cfdb
Merge branch 'refs/heads/fatline'
2013-12-17 22:07:34 +01:00
Jürg Lehni
6b4917f4a8
Clean up code a bit.
2013-12-17 15:23:07 +01:00
Jürg Lehni
45ed406aa3
Remove unnecessary exports.
2013-12-16 21:58:32 +01:00
Jürg Lehni
94b27e933a
Some more variable renaming.
2013-12-16 21:56:41 +01:00
Jürg Lehni
e9d2c6cfd4
Further simplify code a bit.
2013-12-16 21:45:06 +01:00
Jürg Lehni
d984a2cd87
Use correct value for tolerance in non-fatline code again.
2013-12-16 21:41:46 +01:00
Jürg Lehni
a59a42376a
Clean up coding style a bit.
2013-12-16 21:40:40 +01:00
hkrish
5fe092672e
Fatline clipping: fix c-hull corner case.
2013-12-14 00:31:42 +01:00
hkrish
a0013da7f8
Merge branch 'master' into fatline
...
* master: (71 commits)
Define the default value for Color#alpha.
Some minor changes in Satie example.
Include point property in stroke hit-results.
Clean up code and comments in various places.
Use Point.read() for center parameter in Item#rotate
Make hit-tests work again with projects that don't have a view.
Write documentation for Item#anchor.
Keep support for Item#registration for now as well, since there are some scripts on the mailing list that use it.
Rename Item#registration to Item#anchor
No need to run Radial Rainbows in HiDPI mode.
Include Satie Sound Analysis Example.
Only start dragging if none of the mosedown events have stopped propagation.
Fix item-level mousedrag events again.
Allow layers to select children again, since it breaks examples otherwise.
Fix documentation issues in TextItem.
Make hit-test tolerance dependent of view#matrix
Implement options.selected for hit-testing segments and handles.
Fix typo in new segment / handle hit-testing code.
Use same stroke tolerance approach for hit-testing joins and caps as well.
Do not factor in view matrix into Item#globalMatrix.
...
2013-12-13 20:04:43 +01:00
hkrish
5fb75593c2
Remove enpoint fix from curve-line intersections, since it's already handled
2013-12-13 20:01:58 +01:00
Jürg Lehni
d176acfc53
Include point property in stroke hit-results.
2013-12-11 17:10:32 +01:00
hkrish
ef66b6dbe6
Fatline clipping: fix convergence check to be more strict
2013-12-10 20:45:25 +01:00
Jürg Lehni
68bce5b062
Implement options.selected for hit-testing segments and handles.
2013-12-10 19:34:25 +01:00
Jürg Lehni
52891830e4
Fix typo in new segment / handle hit-testing code.
2013-12-10 18:59:04 +01:00
Jürg Lehni
9177bac125
Use same stroke tolerance approach for hit-testing joins and caps as well.
2013-12-10 14:23:05 +01:00
Jürg Lehni
7c28c7e9e3
Do not factor in view matrix into Item#globalMatrix.
...
Instead concatenate it when drawing selections.
2013-12-10 13:18:21 +01:00
Jürg Lehni
48c8946f9e
Implement correct hit-testing tolerance using transformed 2D stroke padding rather than unscaled numerical tolerance.
...
But we still need to factor in the View zoom as well...
2013-12-10 12:52:42 +01:00
Jürg Lehni
d65ede7df8
Correctly take strokePadding and transformation matrices into account in roughBounds, through new Path._getPenPadding()
2013-12-10 11:43:05 +01:00
hkrish
ac41f0d3c1
Fatline clipping: fix issue where one of the curves has been converged completely and other hasn't.
2013-12-09 23:27:26 +01:00
hkrish
0598afd77b
Fatline clipping: remove old #curveIntersection method
2013-12-09 19:36:14 +01:00
Jürg Lehni
b7943239eb
Implement cached getInternalRoughBounds as well.
2013-12-09 19:33:34 +01:00
hkrish
2fa5e3d417
Remove debug helpers
2013-12-09 19:31:58 +01:00
hkrish
82ab532885
Fatline clipping: clipConvexHull method handles only the clipping part
2013-12-09 19:31:04 +01:00
hkrish
35acebb91d
Fatline clipping: remove old fatline code. This is handled by the CurveIntersections method now
2013-12-09 19:30:03 +01:00
hkrish
6041b2b09d
Fatline clipping: new #CurveIntersections method
2013-12-09 19:28:56 +01:00
Jürg Lehni
1e9fc61644
Fix issues with deserializing selection states.
2013-12-09 15:18:43 +01:00
Jürg Lehni
44e913201d
Switch back to instanceof checks.
...
As people are started to subclass Paper.js classes...
2013-12-09 15:04:44 +01:00
Jürg Lehni
e238d23194
Implement caching of internal, untransformed bounds.
2013-12-09 10:53:19 +01:00
hkrish
b471b90229
Fatline clipping: Iterate to find intersections
2013-12-08 23:29:38 +01:00
hkrish
68b9adac95
Modify old clipFatline code to a much cleaner version
2013-12-08 23:15:18 +01:00
hkrish
45e35aad83
New CurveCurveINtersections code; doing the fatline clip inplace.
2013-12-08 23:14:13 +01:00
Jürg Lehni
17e4078e3b
Fix a newly introduced bug in drawSegments()
2013-12-08 22:16:27 +01:00
Jürg Lehni
064d632d65
More matrix related clean-ups.
2013-12-08 22:12:36 +01:00
Jürg Lehni
8cec512cc2
Take matrices into account in PathItem#getIntersections()
2013-12-08 22:00:40 +01:00
Jürg Lehni
516b9d040f
Apply matrices before calculating boolean path operations.
2013-12-08 21:39:56 +01:00
hkrish
6c5e18ae45
New clip convex-hull routine
2013-12-08 19:09:59 +01:00
Jürg Lehni
fc4e88c039
Change the way segments, points and handles are selected and deselected.
...
There is no interdependency anymore, except for selecting a segment selects the point and both handles, and selecting a curve selects both points and handles.
Closes #355
2013-12-08 18:06:31 +01:00
Jürg Lehni
afe00add32
Implement option.type filtering in #hitTest() functions.
2013-12-08 16:32:42 +01:00
Jürg Lehni
2884894d0f
Implement hit-testing tolerance for fill tests.
...
Closes #278 .
2013-12-08 12:15:10 +01:00
hkrish
834c8d17a9
Declutter getConvexHull code.
2013-12-08 00:18:47 +01:00
hkrish
baa189bb19
getConvexHull returns upper and lower part of the c-hull seperately
2013-12-08 00:11:13 +01:00
Jürg Lehni
054356c78d
Fix drawing of closed path with only one segment.
2013-12-07 16:16:04 +01:00
Jürg Lehni
f166b08257
Simplify addCap() function.
2013-12-07 16:11:02 +01:00
Jürg Lehni
eb1f62b908
Improve strokeBounds fix for paths with only one segment.
2013-12-07 16:07:51 +01:00
msand
e431154e0e
Fix indent.
2013-12-07 16:09:50 +02:00
msand
73b1b9843a
Wrote failing test for strokeBounds on paths with a single segment and strokeColor. Implemented fix for failing test.
2013-12-07 15:59:45 +02:00
Jürg Lehni
a50adb1020
Implement constructors for Path and CompoundPath that can handle SVG-style path-data.
2013-12-06 18:09:44 +01:00
Jürg Lehni
92590b160c
Implement Canvas Path caching again using Context#currentPath.
2013-12-06 12:49:46 +01:00
Jürg Lehni
5f24bf8da5
Implement Rectangle#getArea() and use it in reorientPath()
2013-12-03 21:54:36 +01:00
Jürg Lehni
4926e2c8da
Fix Array#sort() call in reorientPath(path) for IE.
...
IE expects integer values in the compare function, not boolean. Closes #350 again.
2013-12-03 21:49:49 +01:00
Jürg Lehni
448d8d9b99
Clean-up bool-fix code.
2013-12-01 23:48:59 +01:00
Jürg Lehni
971268cd72
Merge remote-tracking branch 'origin/master' into bool-fix
2013-12-01 23:28:29 +01:00
Jürg Lehni
6b448ad320
Fix more edge cases in #contains().
...
This should fix issue #346 for good.
2013-12-01 23:13:11 +01:00
hkrish
b625ec5b6d
Merge branch 'master' into bool-fix
...
* master: (127 commits)
Fix edge cases in Curve._getWinding()
Copy over parent style in Item#reduce().
Fire key-up events for all currently pressed keys.
Improve and streamline key-handling logic.
Use renamed __options object in build script too.
Correctly apply matrices to Raster items in #importSVG()
Support passing DOM element IDs in calls to #importSVG()
Update to latest Prepro.js and switch from global options object to __options, to avoid name clashes.
Make directly setting view.onFrame work again.
Update to latest Straps.js and remove unnecessary isArray argument in Base.each()
Add missing DOCS comments.
Fix issue where exceptions in onFrame handlers block future animations.
Fix issue with JSON import.
Add Node JSONtoPDF example.
Implement Item#data cloning.
Remove unnecessary Color#clone() since it's doing the same as Base#clone() now.
Remove Base.merge() and use a new Straps.js feature instead.
Improve build script to include dist file in paperjs.org website.
Bump version to v0.9.14
Fix setting #radius on Shape.Circle.
...
2013-11-30 14:50:18 +01:00
Jürg Lehni
dfc0886a8b
Fix edge cases in Curve._getWinding()
...
Use same rules for lines as for curves, exclude end points of lines. Closes #346 .
2013-11-30 14:21:47 +01:00
Jürg Lehni
93d10983ee
Update to latest Prepro.js and switch from global options object to __options, to avoid name clashes.
2013-11-29 20:26:38 +01:00
Jürg Lehni
1149399690
Add missing DOCS comments.
2013-11-29 18:50:04 +01:00
Jürg Lehni
593e0d8d7f
Remove Base.merge() and use a new Straps.js feature instead.
...
A more clever Base() constructor that allows merging.
2013-11-28 22:20:00 +01:00
Jürg Lehni
5beb0f17ed
Fix hit-testing on paths with a matrix that is not the identity.
2013-11-26 23:13:11 +01:00
Jürg Lehni
8e44049f42
Clean up smooth() code.
2013-11-26 17:32:52 +01:00
Jürg Lehni
d079e179ac
Fix Path#arcBy(to, boolean)
2013-11-25 01:04:51 +01:00
hkrish
274f1a4b55
Sort sub-paths before 'reorienting' during boolean calculations
2013-11-24 13:32:01 +01:00
hkrish
492e78df7d
Handle intersection special case, when two curves' start and end points overlap
2013-11-11 21:20:32 +01:00
Jürg Lehni
1049214126
Remove ctx.currentPath caching again, since it has the current affine transformation factored in and is thus useless to us.
2013-11-06 12:53:10 +01:00
Jürg Lehni
5630b7e415
Implement caching of drawn Canvas Path objects for better performance.
...
Already supported on recent Chrome and Safari.
2013-11-04 11:46:20 +01:00
Jürg Lehni
1301aea47d
Fix issues with importing Ghostscript Tiger.
2013-11-03 12:52:00 +01:00
Jürg Lehni
4f32cc2eea
No need for RegExp group in match statement.
2013-11-02 13:25:03 +01:00
Jürg Lehni
7b1f118aed
Use same command sequence as in switch statement.
2013-11-02 09:45:11 +01:00
Jürg Lehni
97a29e6ada
Improve SVG path data parser.
2013-11-02 09:30:40 +01:00
Jürg Lehni
29c00584be
Fix SVG parsing issues with multiple concatenated coordinate values
...
e.g. "1.5.5", is to be read as "1.5" and ".5"
2013-11-01 17:56:16 +01:00
Jürg Lehni
132f54d362
Define Item#clear() as an alias for Item#removeChildren(), or Path#removeSegments() for paths.
2013-11-01 17:52:27 +01:00
Jürg Lehni
0ded3ae0ba
Implement PathItem#cubicCurveBy() and #quadraticCurveBy()
...
Closes #284 .
2013-10-30 01:43:55 +01:00
Jürg Lehni
eecf68b7c3
Clear ctx.shadowColor after ctx.fill() to avoid application to both fill and stroke.
...
Closes #314 .
2013-10-30 00:00:04 +01:00
Jürg Lehni
4e34a27da4
Some more work on comments.
2013-10-29 21:20:19 +01:00
Jürg Lehni
fd96447ac1
Share ellipse reading code between Shape.Ellipse and Path.Ellipse.
2013-10-29 21:15:28 +01:00
Jürg Lehni
f8d960d834
option.tolerance should always be defined in _hitTest()
2013-10-29 21:00:17 +01:00
Jürg Lehni
c43752dc3e
Use #hasFill() and #hasStroke() more broadly and avoid drawing strokes when strokeWidth is set to 0.
2013-10-29 20:05:39 +01:00
Jürg Lehni
9d60662a28
Check for the occurrence of 'radius' rather than 'center' when deciding to read a center / radius pair for ellipses.
2013-10-29 18:53:55 +01:00
Jürg Lehni
c3aed5277d
Use center and radius in all ellipse code, rather than bounding rect.
...
Simplifies things.
2013-10-29 18:10:30 +01:00
Jürg Lehni
fc9cad009f
Implement CompoundPath#_getWindings() and move #_contains() code for both Path and CompoundPath to PathItem.
2013-10-29 17:57:25 +01:00
Jürg Lehni
d649b1bb21
Define insert argument for Path#toShape() and Shape#toPath()
2013-10-29 16:45:50 +01:00
Jürg Lehni
dc3bd30ee3
Rename some variables and clean up code a bit more.
2013-10-29 16:19:39 +01:00
Jürg Lehni
de01ef1c21
Clean up code from previous merge.
2013-10-29 16:09:35 +01:00
Jürg Lehni
ef972949c8
Merge branch 'refs/heads/intersect-fix'
...
Conflicts:
src/path/Curve.js
2013-10-29 16:06:02 +01:00
hkrish
ac04029f6e
Curve-line intersection fix
2013-10-29 15:52:46 +01:00
Jürg Lehni
63e4bd5db2
Do not use the point of the rotated curve to evaluate the parameter of the line.
...
Use the non-rotated curve instead.
2013-10-29 15:46:20 +01:00
Jürg Lehni
f20e8240cd
Use new range feature of solveCubic()
2013-10-29 15:44:42 +01:00
hkrish
bec1a91812
Calculate correct parameter for Curve-Line intersections
2013-10-29 00:10:20 +01:00
Jürg Lehni
b4850b572a
Improve variable naming.
2013-10-20 01:57:11 +02:00
Jürg Lehni
cc201655af
Fix comment.
2013-10-20 01:54:53 +02:00
Jürg Lehni
e6ef5e7e17
Fix hit-test for compound paths again.
2013-10-20 01:54:20 +02:00
Jürg Lehni
ddeacb1763
More code clean up.
2013-10-20 01:41:31 +02:00
Jürg Lehni
caa50236dd
Simplify winding algorithm by reusing orientation check.
2013-10-20 01:24:07 +02:00
Jürg Lehni
7c4518e4d0
Clean up some variable names.
2013-10-20 00:59:12 +02:00
Jürg Lehni
5db6db3b76
Improve selection serialization to JSON and fix issue in deserialization.
2013-10-18 21:12:25 +02:00
Jürg Lehni
782f5c8f7e
Fix issue with reading selected segment points from JSON when there are no handles.
...
The segment short form was misunderstood by the constructor.
2013-10-18 20:58:06 +02:00
Jürg Lehni
f7c21144a1
Improve handling of strokes in Path#hitTest().
...
Have it match stroke locations when option.stroke is set even when the path has no stroke.
2013-10-18 20:27:47 +02:00
Jürg Lehni
b91c8f93f8
Remove Curve. _getEdgeSum() again, and inline code in Path.isClockwise()
2013-10-18 19:51:54 +02:00
Jürg Lehni
1fc9f882ca
Fix a minor bug in CompoundPath#contains(), improve comments and clean up code.
2013-10-18 19:49:05 +02:00
Jürg Lehni
304ecbc3be
Define compoundChildren hitTest option to get matching children instead of parent.
2013-10-18 15:40:41 +02:00
Jürg Lehni
f8106ae18f
Improve code handling special winding cases.
2013-10-18 15:20:32 +02:00
Jürg Lehni
75a209c002
Handle more special cases in winding algorithm.
2013-10-18 15:15:54 +02:00
Jürg Lehni
5d0fd8f970
Implement Style#windingRule and use it in Path#contains().
2013-10-18 14:54:13 +02:00
Jürg Lehni
4f27be8f12
Include new, improved point in path algorithm based on winding number.
...
It's also possible to switch to using the canvas's native isPointInPath() through options.nativeContains
2013-10-18 14:22:59 +02:00
Jürg Lehni
a07538b205
Use same tolerance in Curve.isLinear() as in Curve#isLinear().
2013-10-17 20:19:34 +02:00
Jürg Lehni
085fa3e1c6
Set named arguments at the end, since some depend on geometry to be defined (e.g. #clockwise).
2013-10-17 14:03:05 +02:00
Jürg Lehni
73d2c34088
Implement item-level #equals() method and clean up other equals methods.
2013-10-17 13:08:54 +02:00
Jürg Lehni
9976033655
Implement serialization of selection.
2013-10-17 12:04:11 +02:00
Jürg Lehni
3958d35f28
Change behavior of Path#fullySelected.
...
Setting it on empty paths does the same as Path#selected.
2013-10-17 12:03:46 +02:00
Jürg Lehni
51cf1cfec6
Clean up Path#toShape().
2013-10-16 23:35:50 +02:00
Jürg Lehni
c4c7a37993
Implement Path#toShape(), Segment#isColinear(), Segment#isOrthogonal() and Segment#isArc().
2013-10-16 23:10:03 +02:00
Jürg Lehni
b581c84d8b
Move CompoundPath#reduce() to Item#reduce().
2013-10-16 16:10:28 +02:00
Jürg Lehni
b325aebc77
Docs: More smaller fixes.
2013-10-16 15:03:29 +02:00
Jürg Lehni
543609c0c6
Have Path.Ellipse constructor support negative radius values correctly.
2013-10-16 14:25:14 +02:00
Jürg Lehni
c945bf7908
Docs: Various smaller clean ups.
2013-10-16 14:20:13 +02:00
Jürg Lehni
3af179e2cf
Docs: Improve Path constructors.
2013-10-16 14:19:25 +02:00
Jürg Lehni
41d6650666
Add support for named center & radius arguments to Path.Ellipse.
2013-10-16 13:32:40 +02:00
Jürg Lehni
4b636dd31c
Clean up Path constructors code.
2013-10-16 13:26:08 +02:00
Jürg Lehni
8fdcbce5ac
Improve argument reading in Segment.
2013-10-16 13:15:08 +02:00
Jürg Lehni
a3d0e0d462
Clean up throw statements.
...
Never throw plain strings.
2013-10-14 16:05:50 +02:00
Jürg Lehni
24e46bee60
Merge branch 'refs/heads/boolean-fix'
2013-10-08 20:50:47 +02:00
Jürg Lehni
0860cdd941
Clean up code a bit.
2013-10-08 20:49:24 +02:00
Jürg Lehni
9103c19e6f
Fix issues with #dashOffset when emulating native dashes.
...
Closes #303 .
2013-10-08 10:50:59 +02:00
Jürg Lehni
1ee6bb7e79
Use isZero() when checking for straight curves in Curve.getLength()
2013-09-23 08:13:32 -07:00
Jürg Lehni
509ac48951
Fix indentation levels.
2013-09-22 18:18:22 -07:00
Jürg Lehni
cae4520665
Simplify addCurveLineIntersections() code.
2013-09-22 18:18:03 -07:00
hkrish
8434b4bebe
Fix: Syntax error!
2013-09-22 17:49:10 +02:00
hkrish
f9b4321a56
Boolean -fix: Interpolate to find the parameter of intersection in linear curve segments
2013-09-21 17:26:14 +02:00
hkrish
0a22211393
Conform to paperjs coding style.
2013-09-21 15:26:14 +02:00
hkrish
4f54ac1f4c
Boolean -fix: Correctly perform boolean operations regardless of the input paths' winding direction
2013-09-17 19:50:13 +02:00
hkrish
669fb1638a
Boolean -fix: Preserve the order of intersections found (Curve-Line) according to the PathItem they belong to.
2013-09-13 02:44:51 +02:00
hkrish
abe0e5e059
Boolean -fix: CurveLocation now keeps track of the correct segment at intersections
2013-09-13 00:08:43 +02:00
Jürg Lehni
19c7788617
Fix documentation irregularities.
2013-08-23 19:45:28 -07:00
Jürg Lehni
6b19f25f4b
Fix typos in comments.
2013-08-08 15:21:35 -07:00
Jürg Lehni
aa4d990c90
Move and unify handling of Item#_set(props) to new Item#_initialize(), and add support for props.insert = false.
2013-07-21 15:45:22 -07:00
Jürg Lehni
93c90d0cd8
Do not insert boolean operation clones into DOM.
2013-07-19 18:46:28 -07:00
Jürg Lehni
b7aea1e527
Use insert: false option in creation of all clones.
...
Still needs implementing in Item constructor.
2013-07-19 18:42:13 -07:00
Jürg Lehni
20a17f2939
Implement insert parameter in Item#clone() to control DOM insertion.
...
Defaults to true. Also insert in the right place now, above the original.
2013-07-19 18:27:00 -07:00
Jürg Lehni
ef4eee1064
Pass true for isParameter in Curve#divide() calls.
...
Closes #252 .
2013-07-04 19:39:55 -07:00
Jürg Lehni
e8765d18d5
Make argument reading more flexible by introducing options object for readNull and clone, and passing it on to the constructor through this.__options for additional values.
2013-06-28 07:37:03 -07:00
Jürg Lehni
8f254202e8
Use new @operator tag to mark math operator methods.
2013-06-28 05:59:07 -07:00
Jürg Lehni
6833e9d8e0
Fix {@default 0.5} values in documentation.
2013-06-27 18:15:10 -07:00
Jürg Lehni
e63edba0b5
Clean up various documentations a bit.
2013-06-27 18:03:03 -07:00
Jürg Lehni
7ade053dea
Move Path.Circle constructor above Path.Rectangle.
2013-06-27 17:54:00 -07:00
Jürg Lehni
f9925a71ea
Improve documentation for Path#split(), Curve#divide() and Curve#split().
...
Closes #189 .
2013-06-27 17:18:57 -07:00
Jürg Lehni
9f5b543ab5
Fix getCurveAt() signature.
2013-06-27 17:13:00 -07:00
Jürg Lehni
38db18c2e1
Remove isParameter from Curve.evaluate()
2013-06-27 17:12:35 -07:00
Jürg Lehni
c123468d7a
Clean up Path#join() code.
2013-06-27 16:06:24 -07:00
Jürg Lehni
2b236a3da8
In Path#join, add first segment of second path again at the end after joining, if it was closed.
...
Closes #249 .
2013-06-27 15:43:26 -07:00
Jürg Lehni
6d38401f0c
Use faster direct Curve constructor instead of Base.create().
2013-06-25 09:58:18 -07:00
Jürg Lehni
52c889428b
Remove Curve.create() in favor of direct constructor.
2013-06-25 09:54:13 -07:00
Jürg Lehni
7e24de7c74
Replace SegmentPoint.create() in favor of normal constructor.
2013-06-25 09:48:51 -07:00
Jürg Lehni
1866e4ff15
Remove need for all special arguments in minification, and restructure code to avoid warnings.
2013-06-24 10:15:54 -07:00
Jürg Lehni
7975232ee7
Remove workaround for obscure WebKit bug.
...
It wasn't fully working either. Solution:
https://bugs.webkit.org/show_bug.cgi?id=109961
2013-06-24 09:37:25 -07:00
Jürg Lehni
a4535edbb9
Bring back _class names, since code minification breaks reliance on constructor.name.
...
Closes #248 .
2013-06-23 20:18:32 -07:00
Jürg Lehni
dff39dff78
Use local bounds for hit-testing.
...
Fixes issue #247 .
2013-06-23 19:49:36 -07:00
Jürg Lehni
719b9d5e24
Move logic that determines if item can be directly composited into separate per-item #_canComposite() method.
2013-06-19 08:22:08 -07:00
Jürg Lehni
258c404b98
Move curvature calculations into Curve.evaluate(), and define unit tests for it.
2013-06-18 19:00:05 -07:00
Jürg Lehni
619a8f88f8
Clean up code a bit in Curve#getCurvatureAt().
2013-06-18 18:29:44 -07:00
Jürg Lehni
f758fb306b
Rename #_applyMatrix to #_transformContent.
...
And swap names with private function...
2013-06-18 15:50:11 -07:00
Jürg Lehni
75acdf1025
Add support for direct drawing of native blendModes for items that allow it.
...
Bypassing compositing into separate canvases completely.
2013-06-18 14:18:57 -07:00
Jürg Lehni
8cf09c08d9
Merge branch 'master' of github.com:paperjs/paper.js
2013-06-18 08:02:22 -07:00
Jürg Lehni
ab2bfe2d40
Rename nativeDash to dash.
2013-06-17 15:52:16 -07:00
hkrish
d4d2075040
Fix: Use absolute coordinates from #Curve.getValues() directly while calculating the curvature
2013-06-17 22:27:20 +05:30
Jürg Lehni
8a726f22b2
Clean up comments.
2013-06-17 08:57:30 -07:00
Jürg Lehni
b072df0486
Put isEnd value directly into conditional.
2013-06-17 08:56:42 -07:00
Jürg Lehni
18ad8a235d
Clean up code to follow Paper.js coding conventions.
2013-06-17 08:26:51 -07:00
Jürg Lehni
be6bbb802d
Move calculations of values to where they are needed.
2013-06-17 08:22:28 -07:00
Jürg Lehni
5ff990a84a
Fix global variable leakage, and join sequential variable definitions.
2013-06-17 08:10:57 -07:00
hkrish
2693516844
Implement correct method for calculating curvature on a Path
2013-06-17 15:16:11 +05:30
Jürg Lehni
f8367bb0dd
More clean-ups.
2013-06-15 05:24:34 -07:00
Jürg Lehni
79785afa2a
Minor clean-ups and optimizations of stroke hit-test code.
2013-06-15 05:21:17 -07:00
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