Jürg Lehni
30374ae3b4
Implement proper index independent argument list reading of basic types.
...
Implemented for Point, Size, Rectangle and Color.
2012-10-18 14:24:15 -07:00
Jürg Lehni
44ad4d885a
Update link to Kaspar Fischer's PDF with new URL.
2012-10-15 15:48:38 -07:00
Jürg Lehni
e17e94b50b
Implement Item#isEmpty() for the various types.
...
And use it to tell #getBounds() when to ignore items.
2012-10-10 20:11:11 -07:00
Jürg Lehni
adb2ddc615
Fix CompoundPath#insertChild.
...
It was not returning success values and thus broke some tests.
2012-10-10 19:54:32 -07:00
Jürg Lehni
ef59ad2875
Improve selection handling and drawing for Path item.
...
In a way that makes more sense when building tools.
2012-10-10 19:33:42 -07:00
Jürg Lehni
523736d9e5
Handle view redraws correctly for all selection changes.
2012-10-08 23:12:43 -07:00
Jürg Lehni
6b08d96c45
Fix issue where out handle was compared to the wrong segment point when drawing.
...
This should fix #106 but needs to be verified before we can close the bug.
2012-10-05 19:08:31 -07:00
Jürg Lehni
77296c4640
Update documentation a bit.
2012-10-05 16:09:15 -07:00
Jürg Lehni
59a55f7574
Merge branch 'master' of github.com:paperjs/paper.js
2012-09-30 14:08:44 -07:00
Jürg Lehni
9e61995282
Handle parameter matching of beginning and ends of curves separately.
2012-09-30 14:06:31 -07:00
Jonathan Puckey
d20fb61c7c
Cleanup code.
2012-04-25 20:47:53 +02:00
Oliver Beattie
3c7563a3bf
When a path is transformed, the _length cache of its Curves should be invalidated
2012-03-17 17:09:54 +00:00
Jonathan Puckey
4d21e219c0
Merge pull request #74 from jonobr1/patch-1
...
Based on logic, I think the else if statement means to refer to c1 rathe...
2012-03-02 03:30:25 -08:00
Jonathan Puckey
c339ffca35
Close closed paths when drawing using Context#closePath(). Fixes #72
2012-03-01 23:25:00 +01:00
Jonathan Puckey
7093b73d31
Cleanup last merged pull request.
2012-03-01 17:06:39 +01:00
Alex Buchanan
f1a6357a05
Path.reverse() should adjust segment indices
2012-02-18 15:13:23 -08:00
Jono Brandel
ad811827fc
Based on logic, I think the else if statement means to refer to c1 rather than c0 again, but I'd like to verify with you guys.
2012-02-07 09:10:33 -08:00
Jürg Lehni
96f7d140a7
Use faster Point.create(x, y) internally.
2011-12-27 20:39:28 +01:00
Jürg Lehni
ad2abfb71f
Inline drawDashes() code.
2011-12-27 20:18:02 +01:00
Jürg Lehni
28806fe977
Ue the faster Matrix#_transformPoint().
...
And reuse Point objects if possible.
2011-12-26 11:06:36 +01:00
Jürg Lehni
7af06502bc
Fix Path#transform() to also return a reference to 'this'.
2011-12-25 16:39:08 +01:00
Jürg Lehni
783d2782c0
Fix wrong HitResult type when hitting Segment#point.
2011-12-25 16:38:43 +01:00
Jürg Lehni
1e690a68e0
Add TODO about HitResult points requiring transformations.
2011-12-25 12:39:10 +01:00
Jürg Lehni
3b0b1184a3
Implement checkSegment() without relying on #_transformCoordinates().
2011-12-25 12:34:51 +01:00
Jürg Lehni
c30ff47930
Remove matrix argument from all hit-testing related methods.
...
We better inverse-transform the point and save the code!
2011-12-25 00:19:01 +01:00
Jürg Lehni
733d879bb6
Add / improve comments about DOCS.
2011-12-23 22:47:10 +01:00
Jürg Lehni
98c82856ea
Override #matrix accessors in Path to do nothing.
...
For the same reasons as described in the previous commit.
2011-12-23 22:46:53 +01:00
Jürg Lehni
627961627e
Have Path always directly apply any transformation to its Segments.
...
This is required so the coordinates of its bounds, length and SegmentPoints are always in the same space.
2011-12-23 22:43:27 +01:00
Jürg Lehni
97b66582f8
Rename Item#applyMatrix() to shorter #apply().
2011-12-23 22:41:05 +01:00
Jürg Lehni
93ede28f3b
Implement new selection drawing mechanism.
...
Using the new Item#globalMatrix.
2011-12-20 11:42:00 +01:00
Jürg Lehni
daca14efb8
Add optional matrix in Path drawing code.
...
Required for new selection drawing mechanism to be implemented.
2011-12-20 11:40:31 +01:00
Jürg Lehni
42087071e7
Fix #strokeBounds for square caps.
...
Calculate the right points at both ends of paths.
2011-12-19 23:30:02 +01:00
Jürg Lehni
1e768e6c83
Fix #strokeBounds for strokes scaled using #matrix.
...
Gotta do the right thing, not the same buggy thing as Illustrator.
2011-12-19 23:21:13 +01:00
Jürg Lehni
4a46c8ac98
Fix recently introduced error with stroke/fillColor handling
...
Since CanvasContext#stroke/fillStyle cannot be set to null, we have to keep checking Style#fill/strokeColor even after calling #_setStyles().
2011-12-19 23:07:14 +01:00
Jürg Lehni
cc26fdc5d1
Optimise handling and setting of fill and stroke styles.
...
Handle setting of fillColor and strokeColor in Item#_setStyles() instead of the various #draw() methods, directly access internal styles instead of using accessor calls and fix PointText#draw().
2011-12-19 22:40:14 +01:00
Jürg Lehni
f5c1125709
Move Path#_setStyles() to Item, so it can be used in PointText too.
2011-12-19 21:25:39 +01:00
Jürg Lehni
466857659c
Unroll loop in Path#_setStyles().
2011-12-19 21:23:28 +01:00
Jürg Lehni
12dbb11ec3
Optimise and simplify ellipse code.
2011-12-19 13:51:26 +01:00
Jürg Lehni
3ccb4a6ebe
Fix strokeBounds calculation when a rotation matrix is in use.
...
The bounding box of the rotated pen ellipse was calculated wrongly.
2011-12-19 13:47:30 +01:00
Jürg Lehni
daa1343155
Add comment about perhaps renaming Path.Oval to Path.Ellipse.
2011-12-19 13:16:29 +01:00
Jürg Lehni
83df011e1d
Add missing colon.
2011-12-19 13:16:06 +01:00
Jürg Lehni
9e5eb17264
Improve Item#transform() and implement #applyMatrix() to support nested matrices. Work in progress.
2011-12-18 16:54:21 +01:00
Jürg Lehni
120ead209e
Define Segment#clone().
2011-12-07 11:54:41 +01:00
Jürg Lehni
566aaed0be
Define Segment#equals().
2011-12-07 11:53:07 +01:00
Jürg Lehni
3ece08bea1
Fix handling of recursion in Item#setSelected() / #setFullySelected().
2011-11-30 17:16:52 +01:00
Jürg Lehni
b51cf064b0
Make baseItem to last optional parameter of _getBounds.
2011-11-26 11:55:19 +01:00
Jürg Lehni
f799c85e76
Switch to using 'this' in private getBounds methods to point to path item rather than 'that'.
2011-11-26 11:48:08 +01:00
Jürg Lehni
a0ad81b576
Pass on the baseItem of a getBounds call, required to implement proper caching later.
2011-11-26 11:24:48 +01:00
Jürg Lehni
569c415b2f
Start implementing bounds caching the new way.
...
Work in progress still.
2011-11-24 15:37:44 +01:00
Jürg Lehni
c989d3ee3f
Restructure code a bit for easier reading.
2011-11-24 15:18:57 +01:00
Jürg Lehni
ea87be166e
Part one of big refactoring of bouding box handling. Functional, but caching is broken right now.
2011-11-24 15:13:21 +01:00
Jürg Lehni
b96cd4e1c8
Add comments about possible optimization of accessing of style properties.
2011-11-24 14:53:38 +01:00
Jürg Lehni
3f5e68aa76
Document the private getPendPadding() function.
2011-11-24 10:21:12 +01:00
Jürg Lehni
29aaf38320
Improve comments.
2011-11-24 10:17:31 +01:00
Jürg Lehni
cd1810e6a3
Fix arguments check in Path#getHandleBounds().
2011-11-23 18:13:05 +01:00
Jürg Lehni
b9f6c99dcd
Add comments and clean up code.
2011-11-17 19:28:05 +01:00
Jürg Lehni
c8e1a9c959
Merge remote-tracking branch 'origin/master'
2011-11-12 23:57:39 +01:00
Jürg Lehni
4ba752d42a
Add note and TODO about Path#contains() only working correctly for no-zero winding rule, which is not used by Canvas...
2011-11-12 19:49:12 +01:00
Jürg Lehni
ddf7c6534b
Fix Path#hitTest() to only consider strokeWidth if a strokeColor is provided too.
2011-11-12 19:48:39 +01:00
Jonathan Puckey
52385451f6
Resolve a few documentation todos.
2011-11-12 18:30:21 +01:00
Jonathan Puckey
3ac171a304
Path#smooth() example: select path using fullySelected instead of selected, so we can see its handles.
2011-11-12 16:45:33 +01:00
Jürg Lehni
a326b189b4
Improve Curve#isFlatEnough() by finding the right threshold through testing, and remove other less precise solutions.
2011-11-12 01:23:41 +01:00
Jürg Lehni
d43b54a531
Shorten Curve.isFlatEnough() code.
2011-11-11 20:58:33 +01:00
Jürg Lehni
fdd4ee8d31
Switch back to Kaspar Fischer's version of Curve.isFlatEnough, as it produces the best results with dashed lines.
2011-11-11 20:55:31 +01:00
Jürg Lehni
af9df0e1b8
Provide point of hit handles and segments too in HitResult.
2011-11-11 14:47:03 +01:00
Jürg Lehni
c4bea4d24c
Include comment about algorithm modifications.
2011-11-10 18:30:18 +01:00
Jürg Lehni
3397931bb2
Be consistent in Numerical. EPSILON comparison rules.
2011-09-22 21:14:16 +02:00
Jürg Lehni
571ca31dbf
Move ctx.restore() to same level as ctx.save(). Closes #51 .
2011-09-18 10:56:04 +02:00
Jürg Lehni
4e1dd90549
Use faster Size.create().
2011-08-16 13:52:31 +02:00
Jürg Lehni
4dd90b440e
Use new dontLink parameter for Path.Constructors optimisations.
2011-08-16 13:52:18 +02:00
Jürg Lehni
8f8188a091
Optimise Path.Rectangle constructor.
2011-08-16 13:39:37 +02:00
Jürg Lehni
3c5a46a8af
Implement SegmentPoint#isZero() that does not use the x / y accessors but the internal properties directly, for performance reasons, since it is used a lot internally.
2011-08-16 13:38:52 +02:00
Jürg Lehni
7e0307dd6a
Correct comments.
2011-08-16 13:36:58 +02:00
Jonathan Puckey
3a3f5ecabb
Segment: notify path of change when selection state of handles changes, so the view is redrawn.
2011-08-04 10:54:56 +02:00
Jürg Lehni
a8c08b3301
Docs: Document Path#getNearestLocation() and #getNearestPoint().
2011-08-01 11:48:27 +01:00
Jürg Lehni
7f81184848
Only intersect lines if their lengths are not conflicting with Numerical.EPSILON comparison of the cross product in Line#intersect().
2011-07-30 11:38:17 +01:00
Jürg Lehni
7d0db22b9b
Use squared distances in nearest point algorithm.
2011-07-30 11:37:07 +01:00
Jürg Lehni
3a7c5286b5
Improve precision of Line#intersect() and other parts that check for a divisor to not be 0, by comparing against the new Numerical.EPSILON rather than Numerical.TOLERANCE.
2011-07-28 11:03:59 +01:00
Jonathan Puckey
60a4292691
Fix the way children of CompoundPath have their orientation set by overriding Item#insertChild(index, item).
2011-07-27 20:30:39 +02:00
Jonathan Puckey
63628be923
Fix bug in CompoundPath#draw(ctx, draw) which was causing an error when a compound path didn't have any children.
2011-07-25 21:41:09 +02:00
Jonathan Puckey
53a602fb56
Path#_hitTest: check that a stroke hit test was requested.
2011-07-15 14:50:42 +02:00
Jonathan Puckey
91ab38ffd1
Path#getHandleBounds: remove optimization as it leads to problems when hit testing handles.
2011-07-15 12:58:34 +02:00
Jürg Lehni
a3bfc8fe40
Support all ways of defining a Point in SegmentPoint.create(), through fallback to Point.read().
2011-07-13 12:46:16 +01:00
Jonathan Puckey
ff685f294a
Fix problem with passing a Size to the Segment constructor.
2011-07-13 13:29:50 +02:00
Jürg Lehni
254aee47f8
Implement Path#getLocation(point)
2011-07-09 17:12:27 +02:00
Jürg Lehni
55f815cb72
Remove obsolete TODOs.
2011-07-09 17:12:13 +02:00
Jürg Lehni
45c7f9c4fc
Port back code to prevent tangents and normals of length 0 from Scriptographer.
2011-07-09 11:20:03 +02:00
Jürg Lehni
ebd3bfc092
Introduce faster versions of Rectangle#contains() that do not perform checks.
2011-07-09 11:07:12 +02:00
Jürg Lehni
833d4968ce
Change root solvers to not produce new arrays each time but fill a passed one that can be reused. Yields io impressive performance improvements.
2011-07-09 10:50:47 +02:00
Jürg Lehni
839107d341
Remove faulty code for calculation of tangents / normals.
2011-07-09 10:35:22 +02:00
Jürg Lehni
ec00150df2
Remove unused variable.
2011-07-09 10:34:18 +02:00
Jürg Lehni
4e1d613ed8
Fix Curve#getLength() again for straight lines.
2011-07-09 10:21:17 +02:00
Jürg Lehni
17b412ce6f
Fix a newly introduced bug in #contains().
2011-07-09 10:17:06 +02:00
Jürg Lehni
8a6d53766e
Explain code a litter better.
2011-07-09 10:11:50 +02:00
Jürg Lehni
8928a7b057
Fix #getCrossings() where calling #getPoint() / #getTangent() was slow and also wrong when a matrix was used.
2011-07-09 10:09:41 +02:00
Jürg Lehni
8606f25542
Switch from using Function#apply() trick for passing curve values as function parameters to simply passing arrays and looking up the values on then.
2011-07-09 10:08:43 +02:00
Jürg Lehni
23f38c6e5b
Fix Path#flatten(), where we don't want to add last segment again for closed paths.
2011-07-09 09:51:06 +02:00
Jürg Lehni
74b23c1882
Use #roughBounds rather than #bounds in #contains() check.
2011-07-09 09:27:54 +02:00
Jürg Lehni
0a7f5a12a5
Fix bug in 'stroke' hit-results.
2011-07-08 23:32:29 +02:00
Jürg Lehni
c033a5a7bc
Implement hit-test options: segments, handles and ends.
2011-07-08 23:26:21 +02:00
Jürg Lehni
bb4e71da81
Clean up isFlatEnough() code.
2011-07-08 22:26:22 +02:00
Jürg Lehni
dfbe3135ad
Remove HitResult inheritance from CurveLocation, but have a #location property pointing to it.
2011-07-08 22:25:42 +02:00
Jonathan Puckey
36be78c671
Fix small problem in Item#_hitTest.
2011-07-08 18:41:29 +02:00
Jonathan Puckey
a0f4371803
Fix CurveLocation#getSegment.
2011-07-08 18:39:05 +02:00
Jürg Lehni
fe37ce6bcb
Clean up comments.
2011-07-07 23:02:26 +02:00
Jürg Lehni
23c4499d15
Add comments about how to potentially improve getBounds() accuracy.
2011-07-07 23:00:40 +02:00
Jürg Lehni
ca50461fd1
Implement new Curve.isFlatEnough().
2011-07-07 23:00:16 +02:00
Jürg Lehni
69a7d0bfd4
Implement a first version of Item#hitTest(), so far working only for Path items. Work in progress.
2011-07-07 22:14:58 +02:00
Jürg Lehni
f15a541468
Improve documentation.
2011-07-07 16:10:27 +02:00
Jürg Lehni
64ae48af0b
Remove solved TODO.
2011-07-07 16:10:06 +02:00
Jürg Lehni
5655981f6d
Clean up white spaces.
2011-07-07 16:09:02 +02:00
Jürg Lehni
e573fe5dcd
Do not pass prevSlope to Curve#getCrossings(), rely on #getPrevious() instead.
2011-07-07 16:08:10 +02:00
Jürg Lehni
4a53503130
Add support for optional matrix in Path#contains(), Path#getNearestLocation(), Curve#getValues(), Curve#getCrossings(), Curve#getNearestLocation()
2011-07-07 16:07:29 +02:00
Jürg Lehni
9d2148245a
Implement Curve#getParameter(point), untested.
2011-07-06 23:15:32 +02:00
Jürg Lehni
56d62108cf
Rename PathFlattener#getParameter(offset) -> #getParameterAt(offset)
2011-07-06 23:14:18 +02:00
Jürg Lehni
b13c7622c8
Rename Curve#getParameter(length) -> Curve#getParameterAt(offset)
2011-07-06 23:13:38 +02:00
Jürg Lehni
778a161ba0
Rename Curve.solve() -> Curve.solveCubic()
2011-07-06 23:10:16 +02:00
Jürg Lehni
d6b666024b
Define #getNearestLocation() / #getNearestPoint() for Path.
2011-07-06 22:25:20 +02:00
Jürg Lehni
fadf6e98b5
Pass on minDistance to CurveLocation.
2011-07-06 22:21:49 +02:00
Jürg Lehni
c35133fae9
Add CurveLocation#distance, for Curve#getNearestLocation().
2011-07-06 22:19:01 +02:00
Jürg Lehni
0c0807e3e9
Streamline handling of undefined properties in CurveLocation.
2011-07-06 22:18:40 +02:00
Jürg Lehni
30e92c8a35
Simplify CurveLocation#getPoint(), as missing parameter cannot be determined if point is also undefined.
2011-07-06 22:14:44 +02:00
Jürg Lehni
17bdaf6fe4
Use CurveLocation for Curve#getNearest*() methods.
2011-07-06 22:08:10 +02:00
Jürg Lehni
8b6d9746ce
Rename Curve#getCrossingsFor() -> #getCrossings()
2011-07-06 22:07:34 +02:00
Jürg Lehni
5c3a6f72b6
Fix comments.
2011-07-06 15:31:16 +02:00
Jürg Lehni
ccd4113ba3
Implement Nearest Point-on-Curve Problem.
2011-07-05 13:20:31 +02:00
Jürg Lehni
4630a1bd4a
Fix documentation.
2011-07-05 13:17:34 +02:00
Jürg Lehni
c1f46977fa
Rename Curve.isSufficientlyFlat() to shorter Curve.isFlatEnough()
2011-07-05 13:17:07 +02:00
Jürg Lehni
4110a56521
Improve comments.
2011-07-05 01:20:25 +02:00
Jürg Lehni
6cc7417201
Handle edge case in crossing number algorithm where the beam in right x-direction is touching a tip where the curves change y-direction but do not interesect with the shape, by checking for slope changes.
2011-07-05 01:15:45 +02:00
Jürg Lehni
4924d683e4
Simplify Curve.solve() and improve documentation.
2011-07-04 23:42:16 +02:00
Jürg Lehni
c5269ecbab
Implement Path#contains(point) efficiently using the crossing number algorithm and our cubic polynomial solver.
2011-07-04 23:32:15 +02:00
Jürg Lehni
dad118cc20
Fix comments.
2011-07-04 23:30:25 +02:00
Jürg Lehni
45a3e7f873
Big refactoring of the way bounds are handled and cached, properly supporting Groups inside Symbols, and also adding #roughBounds, to be used by upcoming hit testing code.
2011-07-04 19:45:53 +02:00
Jürg Lehni
e88043a1f4
Implement Path#roughBounds, based on an improved Path#getHandleBounds() that supports additional hidden join and stroke padding parameters.
2011-07-02 18:27:43 +02:00
Jürg Lehni
3eecb924c8
Fix bug in Segment#_transformCoordinates, where handles were not set when they were zero, change was false and no matrix was provided.
2011-07-02 06:24:27 +02:00
Jürg Lehni
0644d9d8b5
Move TODOs up to where they make sense.
2011-07-01 17:40:29 +02:00
Jürg Lehni
51d6ff945e
Improve Path#getHandleBounds() and fix bean access for #handleOut.
2011-07-01 17:39:39 +02:00
Jürg Lehni
aa9be1d9c5
Rename #controlBounds -> #handleBounds, to reflect terminology used elsewhere.
2011-07-01 17:23:10 +02:00
Jürg Lehni
9fa51a0457
Implement Item#controlBounds and Path#controlBounds, and test it in StrokeBounds example. This is a first step towards fast hit-testing.
2011-07-01 12:51:18 +02:00
Jürg Lehni
84bce71b1c
Remove unnecessary Segment#getHandleIn/OutIfSet.
2011-07-01 12:30:10 +02:00
Jürg Lehni
79c0ad8cc5
Update copyright notices.
2011-07-01 12:17:45 +02:00
Jürg Lehni
7211e68245
Add documentation to PathItem class.
2011-07-01 11:22:33 +02:00
Richard D. Worth
ac39873693
Whitespace. Removed all trailing whitespace from .js files
2011-06-30 06:01:51 -04:00
Jürg Lehni
0eb033e6bf
Only try to simplfy path if there are more than two segments in it.
2011-06-27 22:35:02 +02:00
Jürg Lehni
50c7649421
Improve Segment and Curve documentation.
2011-06-27 15:07:08 +02:00
Jürg Lehni
e35b171bec
Improve Curve documentation.
2011-06-27 14:58:17 +02:00
Jürg Lehni
cd2fce9bc7
Clean up documentation.
2011-06-27 12:31:39 +02:00
Jürg Lehni
4a344c8fad
Clean up forgotten @lends statements.
2011-06-22 23:58:50 +01:00
Jürg Lehni
7cd749e63d
Change all documentation to new convention of defining @class outside injection scope, fix some comments and a few errors with examples.
2011-06-22 23:56:05 +01:00
Jürg Lehni
2f2b3ed7e0
Fix selection behavior when segment lists are cleared, in which case we expect the path to remain selected.
2011-06-20 19:08:34 +01:00
Jonathan Puckey
a2a8939d5d
Path# rename #pointsToCurves to #simplify and #curvesToPoints to #flatten.
2011-06-20 19:17:07 +02:00
Jürg Lehni
37f5a64dce
Improve _bounds handling by introducing Item#_createBounds() that always uses LinkedRectangle class.
2011-06-20 17:34:43 +01:00
Jürg Lehni
995c5b4081
Fix error in miter calculation in Path#getStrokeBounds(), recently introduced by a fix in Curve#getNormal().
2011-06-20 15:56:08 +01:00
Jürg Lehni
c1fcd6f3bb
Documentation: Convert more Array return types to Type[].
2011-06-20 14:27:54 +01:00
Jonathan Puckey
e23282fe05
Documentation: convert Array return types to Type[].
2011-06-20 15:19:08 +02:00
Jürg Lehni
7a90f9260e
Have subclasses of Item call the base version of _changed().
2011-06-19 22:40:49 +01:00
Jürg Lehni
0df909dd71
Rename ChangeFlags -> ChangeFlag.
2011-06-19 22:21:14 +01:00
Jürg Lehni
f0bc3f115b
Have all visual changes include ChangeFlags.APPEARANCE.
2011-06-19 22:20:28 +01:00
Jürg Lehni
2594a41b7d
Remove the mention of optional parameters in documentation, as they are marked optional already.
2011-06-19 21:52:52 +01:00
Jürg Lehni
bbcec27031
Move support for _bounds caching to Item and start using it in PlacedSymbol.
2011-06-19 18:07:53 +01:00
Jürg Lehni
fe416e294d
Fix issue with a path not being selected when one of its segment is selected directly.
2011-06-17 19:00:41 +01:00
Jürg Lehni
ca16e43c1f
Implement getters / setters for #locked, #visible, #blendMode and #opacity, and call _changed() from setters.
2011-06-17 18:53:34 +01:00
Jürg Lehni
3226147e00
Use a version of Bootstrap that always produces beans and remove all beans: true instructions.
2011-06-17 18:42:29 +01:00
Jürg Lehni
5bc4f69856
Improve documentation for Path#removeSegments().
2011-06-17 17:54:37 +01:00
Jürg Lehni
7dcdb5ca2f
Improve documentation for Path#removeSegments().
2011-06-17 17:46:42 +01:00
Jürg Lehni
6f4a9d5c7b
Merge branch 'master' of github.com:scriptographer/paper.js
...
Conflicts:
test/tests/Item.js
2011-06-17 16:36:58 +01:00
Jonathan Puckey
ea9c9353e3
Merge branch 'master' of https://github.com/scriptographer/paper.js
2011-06-17 16:59:42 +02:00
Jonathan Puckey
6fc08c6417
Item: implement #addChild(item), #insertChild(index, item), #insertAbove(item) and #insertBelow(item) Deprecate: #moveAbove, #moveBelow, #appendTop, #appendBottom.
2011-06-17 16:58:41 +02:00
Jürg Lehni
503a031bdf
Allow CompoundPath to have named children.
2011-06-17 14:11:37 +01:00
Jürg Lehni
f4d15200ee
Remove Group#_clipped and solely use Item#_clipMask to handle clipping internally.
2011-06-17 13:56:02 +01:00
Jürg Lehni
1615b50b68
Fix thrown Error messages.
2011-06-17 11:26:35 +01:00
Jürg Lehni
6e16ab81f4
Fix a bug in Path#arcTo() where sometimes the arc was drawn on the wrong side when the extent was 180 degrees, thus the center point was lying on the line (from, to).
2011-06-16 23:50:14 +01:00
Jürg Lehni
169b58e550
Fix argument reading for PathItem#arcTo(to, clockwise).
2011-06-16 23:48:46 +01:00
Jürg Lehni
8d49d2377b
Fix documentation for PathItem#smooth().
2011-06-16 23:37:45 +01:00
Jürg Lehni
c2d425c916
Improve Error message thrown when no arc can be drawn.
2011-06-16 22:50:59 +01:00
Jürg Lehni
6e7d23faa4
Improve #arcTo() documentation.
2011-06-16 22:38:58 +01:00
Jürg Lehni
2c83eeb7de
Improve handling of Path#arcTo() when the arguments demand an infinitely big circle, by either drawing a line or bailing out.
2011-06-16 22:38:43 +01:00
Jürg Lehni
aa825302e4
Clean up documentation for PathItem, Path & CompoundPath, by moving shared documentation to PathItem, for methods that are supposed to be abstract in PathItem and shared between the two classes.
2011-06-16 22:07:00 +01:00
Jürg Lehni
cb463b74f5
Fix @extends tags in documentation: Only the immediately following class is required.
2011-06-16 21:43:31 +01:00
Jürg Lehni
9deabbee8d
Start adding documentation to PathItem.
2011-06-14 23:04:32 +01:00
Jürg Lehni
401c4d5dc4
Rearrange @constructor documentation sequence.
2011-06-14 23:01:35 +01:00
Jürg Lehni
ffa79f4fd1
Clean up white spaces in comments.
2011-06-14 22:59:45 +01:00
Jürg Lehni
a7d22b2165
Add comment about porting back Path#arcTo().
2011-06-14 21:32:14 +01:00
Jürg Lehni
8213dce4a9
Have newly added segments selected if path was fully selected before.
2011-06-14 15:40:03 +01:00
Jürg Lehni
a32b687bfd
Bigger refactoring of handling of segment selection: Have Path#_selectedSegmentState be the summed up value of all Segment's states, and compare it to segments.length * SelectionState.POINT in #fullySelected.
2011-06-14 15:37:25 +01:00
Jürg Lehni
ad78474ae4
Remove obsolete TODO.
2011-06-14 12:46:15 +01:00
Jürg Lehni
50bc64779f
Handle special case of infinitely big circle in Path#arcTo(), by cheating using an approximation of a really big circle.
2011-06-14 12:45:37 +01:00
Jürg Lehni
2be18b8013
Completely rewrite Path#arcTo() using Point class and vector geometry methods.
2011-06-14 12:19:14 +01:00
Jürg Lehni
8d0bb3d2ae
Path#arcTo(): Fix wrong constant names.
2011-06-14 09:32:53 +01:00
Jürg Lehni
b4a210e113
Path#arcTo(): Fix the case where through point lies on a line between from and to point.
2011-06-14 09:12:18 +01:00
Jürg Lehni
f0c22bc1dc
Shorten pre-calculations in Path#arcTo().
2011-06-14 09:00:55 +01:00
Jürg Lehni
f6b2672f08
Simplify Path#arcTo() arguments check.
2011-06-14 09:00:25 +01:00
Jürg Lehni
a3d1875971
More clean ups.
2011-06-13 19:09:10 +01:00
Jürg Lehni
de739b42a8
Clean up white spaces.
2011-06-13 19:05:17 +01:00
Jürg Lehni
064f17eaec
Fix default value for end in Path#removeSegments(), so the last segment gets removed too.
2011-06-13 19:00:39 +01:00
Jürg Lehni
4a23e35eee
Merge remote-tracking branch 'origin/master'
2011-06-12 18:42:24 +01:00
Jürg Lehni
c341ec220a
Fix white space.
2011-06-12 18:40:30 +01:00
Jürg Lehni
065777291e
Fix filtering of duplace points in path fitting code.
2011-06-12 18:40:24 +01:00
Jonathan Puckey
20fc389020
Documentation: add see tag to Path#closePath().
2011-06-10 13:33:14 +02:00
Jonathan Puckey
87c1b564d2
Document Path#lineBy(vector).
2011-06-10 13:32:37 +02:00
Jonathan Puckey
ac703f1baa
Path: add example of pointToCurves().
2011-06-10 00:07:25 +02:00
Jürg Lehni
928b7df01e
Fix typo introduced in previous refactoring.
2011-06-06 17:18:22 +01:00
Jürg Lehni
046f9cef6e
Add comments.
2011-06-05 23:14:36 +01:00
Jürg Lehni
2fe21586df
Further simplifications of path fitter code.
2011-06-05 23:14:28 +01:00
Jürg Lehni
3a4af3f854
Rename variables forgotten in previous refactoring.
2011-06-05 23:13:45 +01:00
Jürg Lehni
b035077d31
Simplify code.
2011-06-05 23:00:33 +01:00
Jürg Lehni
9e25047b91
Further clean ups.
2011-06-05 22:09:19 +01:00
Jürg Lehni
68eb14c00d
Clean up code.
2011-06-05 22:06:24 +01:00
Jürg Lehni
10e1417dc2
Check for denominator == 0 with tolerance.
2011-06-05 21:59:42 +01:00
Jürg Lehni
0366752a6f
Merge remote-tracking branch 'origin/master'
2011-06-05 21:56:17 +01:00
Jürg Lehni
73a188742e
Fix bug in singularity check.
2011-06-05 21:56:04 +01:00
Jürg Lehni
ee7147d58e
Rename forgotten variables in previous refactoring.
2011-06-05 21:51:01 +01:00
Jonathan Puckey
b385b859f9
Merge remote branch 'origin/master'
2011-06-05 22:46:22 +02:00
Jürg Lehni
6ea63fde43
Handle case of nearly singular matrix separately.
2011-06-05 21:45:29 +01:00
Jürg Lehni
27c7248a2d
Clean up and shorten code.
2011-06-05 21:44:34 +01:00
Jonathan Puckey
d2759c2371
Improve Segment constructor example.
2011-06-05 22:44:32 +02:00
Jonathan Puckey
9d4afcfe9c
Add another Path#add example.
2011-06-05 22:44:01 +02:00
Jonathan Puckey
5513687daa
Add Path#smooth examples.
2011-06-05 22:43:36 +02:00
Jürg Lehni
12e770c032
Merge remote-tracking branch 'origin/master'
2011-06-05 21:32:10 +01:00
Jürg Lehni
bcb5df9f04
Clean up.
2011-06-05 21:31:58 +01:00
Jürg Lehni
ca18b20785
Remove Douglas–Peucker algorithm again since it produced ackward results.
2011-06-05 21:29:19 +01:00
Jürg Lehni
42f5b5e26e
Implement Douglas–Peucker algorithm for point reduction before the curve fitting.
2011-06-05 21:28:49 +01:00
Jürg Lehni
aef8dcf2d3
Check for determinant singularity and handle separately.
2011-06-05 21:27:24 +01:00
Jürg Lehni
7d2742cd94
Rename PathFitter#process() -> #fit().
2011-06-05 21:26:01 +01:00
Jürg Lehni
4854e56e1d
Filter out adjacent duplicate points.
2011-06-05 21:25:38 +01:00
Jonathan Puckey
fe901fa96b
Add to and improve Path documentation.
2011-06-05 22:02:30 +02:00
Jürg Lehni
28c680ac94
Implement PathFitter and Path#pointsToCurves().
2011-06-05 19:27:18 +01:00
Jürg Lehni
caec7599be
Fix a bug with Segment constructor where two passed points with the first one having an x-coordinate of 0 would accidentaly be considered the two coordinate values for the point property.
2011-06-05 18:41:58 +01:00
Jonathan Puckey
e4eb463204
Path: document arcTo and curveTo.
2011-06-05 18:40:33 +02:00
Jonathan Puckey
14e2a61d25
Add examples to Path#arcTo docs.
2011-06-05 17:22:35 +02:00
Jonathan Puckey
ab09a44dc6
Add examples to Path#join documentation.
2011-06-05 16:12:31 +02:00
Jonathan Puckey
c10aa01de0
Fix a bug in Path#join.
2011-06-05 15:56:37 +02:00
Jonathan Puckey
5770ebc9ff
Merge remote branch 'origin/master'
2011-06-05 15:04:43 +02:00
Jonathan Puckey
deec7512cc
Path: fix return type in #getLocationAt documentation.
2011-06-05 15:04:34 +02:00
Jonathan Puckey
34b510bf1c
Path: add examples to #getPointAt, #getNormalAt and #getTangentAt.
2011-06-05 15:00:43 +02:00
Jonathan Puckey
bb956c890f
Add documentation stub for Path#arcTo(through, to)
2011-06-05 14:52:01 +02:00
Jonathan Puckey
4e0a857ee7
Fix a problem in Path#arcTo where it wasn't defaulting to a clockwise arc.
2011-06-05 14:51:37 +02:00
Jürg Lehni
b3d771a870
Remove Curve#transform() which is currently broken anyhow.
2011-06-05 13:27:39 +01:00
Jürg Lehni
e76c4e0de1
Implement Path#curvesToPoints() using the new PathFlattener class.
2011-06-05 13:21:00 +01:00
Jürg Lehni
74b9da9882
Define PathFlattener#evaluate() for curve evaluation at given offsets.
2011-06-05 13:20:20 +01:00
Jürg Lehni
c296eb0883
Fix wrong direction of tangent evaluation at t = 1.
2011-06-05 13:09:53 +01:00
Jürg Lehni
c2c5955717
Rename Curve#getCurvesValues() -> #getValues().
2011-06-05 12:40:07 +01:00
Jürg Lehni
cb3834f41c
Expose the previously private evalutate() function through Curve.evaluate(), make it work with curve value arrays, and use it the for various evaluation methods (#getPoint/Tangent/Normal).
2011-06-05 12:37:43 +01:00
Jürg Lehni
14816a872e
Define Curve constructor for 8 parameters and implement Curve#getPart() that returns a new sub curve.
2011-06-05 12:36:26 +01:00
Jürg Lehni
3a0f43050e
Rename length to offset.
2011-06-05 11:34:40 +01:00
Jürg Lehni
ef10c2797c
Add Curve#getPart but hide for now as more work is required.
2011-06-05 11:34:24 +01:00
Jürg Lehni
b5a0979f58
Access internal Curve coordinate properties directly rather than through beans.
2011-06-05 11:33:55 +01:00
Jürg Lehni
47085e44ca
Fix drawing of closed paths that was broken in recent commit.
2011-06-05 11:20:28 +01:00
Jürg Lehni
6095723e70
Fix single equal compare.
2011-06-04 21:46:48 +01:00
Jürg Lehni
90be683113
Clean up and add more comments.
2011-06-04 19:25:50 +01:00
Jürg Lehni
263fa8cbd9
Add comments.
2011-06-04 18:35:00 +01:00
Jürg Lehni
fafb6d1d76
Convert CurveFlattener to PathFlattener, which can handle drawing of parts accross curve boundaries.
2011-06-04 18:25:41 +01:00
Jürg Lehni
e097ff1303
Include copyright notice and clean up.
2011-06-04 16:12:55 +01:00
Jürg Lehni
5fa43efb79
Merge remote-tracking branch 'origin/master'
2011-06-04 16:08:52 +01:00
Jürg Lehni
6c74ace1ed
Implement dashed stroke support. Work in progress.
2011-06-04 16:08:40 +01:00
Jürg Lehni
e5290c3f47
More work on Path#draw().
2011-06-04 15:28:06 +01:00
Jürg Lehni
45a04891ee
Clean up.
2011-06-04 15:16:30 +01:00
Jürg Lehni
91886211b5
Simplify Path#draw() by defining a private drawSegment() that's used to close paths too.
2011-06-04 15:16:21 +01:00
Jonathan Puckey
a96b272f7a
Documentation edits.
2011-06-04 15:50:29 +02:00
Jürg Lehni
ce01d2cc59
Start implementing CurveFlattener, as required for dashing.
2011-06-04 12:40:58 +01:00
Jürg Lehni
bff3e14155
Implement a first crude version of Curve.isSufficientlyFlat()
2011-06-04 12:40:36 +01:00
Jürg Lehni
5581eefd0c
Define default value of t = 0.5 in Curve.subdivide().
2011-06-04 12:40:07 +01:00
Jonathan Puckey
5e05f38df0
Path docs: add return tag for #getLocationAt.
2011-06-03 23:06:05 +02:00
Jonathan Puckey
d77e9cfb4f
Path docs: add Positions on Paths and Curves group title and temporary Path Smoothing group title.
2011-06-03 23:05:22 +02:00
Jonathan Puckey
083099a919
Add Path#closed example.
2011-06-03 23:04:18 +02:00
Jonathan Puckey
7d1297fcf4
Path#draw: Fix drawing of selected path handles.
2011-06-03 11:33:34 +02:00
Jürg Lehni
29967153c3
Clean up TODO comments...
2011-06-01 10:49:43 +01:00
Jonathan Puckey
2b8f1b71ec
Documentation: use inline code tags for boolean and number values,
2011-05-31 14:28:42 +02:00
Jonathan Puckey
17fcb923ff
Documentation: rearrange @example tags, improve examples, rename boolean -> Boolean and misc smaller edits.
2011-05-30 19:42:17 +02:00
Jonathan Puckey
16f521b8a2
Path.Constructors docs: move @example tags to the end of the comments and shorten the lines of the examples.
2011-05-30 17:13:19 +02:00
Jürg Lehni
9d00541987
Clean up PORT comments.
2011-05-29 19:20:10 +01:00
Jonathan Puckey
742d7f809d
Segment: document #toString and #selected.
2011-05-29 16:57:48 +02:00
Jonathan Puckey
6b63bb8a36
Documention: add postscript methods to CompoundPath
2011-05-29 16:49:52 +02:00
Jonathan Puckey
41bf1f4543
CompoundPath: document #moveTo and #moveBy.
2011-05-29 16:13:30 +02:00
Jonathan Puckey
0b9c034e0d
Path: document #addSegments and #insertSegments
2011-05-29 16:06:23 +02:00
Jonathan Puckey
78ab493709
Documentation: add todo to Path#add
2011-05-29 16:05:47 +02:00
Jonathan Puckey
cd76c8c0e1
Documentation: remove ^n from method names, since this isn't necessary anymore.
2011-05-28 02:18:10 +02:00
Jonathan Puckey
1520cad144
Documentation: capitalize basic types in @ tags.
2011-05-27 21:21:49 +02:00
Jonathan Puckey
8e84c79aa6
Documentation: capitalize 'string' and 'number' types.
2011-05-27 20:15:15 +02:00
Jonathan Puckey
25c3534dc1
Documentation: remove part of the constructor explanation of CurveLocation until the mentioned functions have been added.
2011-05-27 20:06:57 +02:00
Jonathan Puckey
4015b022ad
Docs: use @true tag in boolean return descriptions and add Key.isDown param options.
2011-05-27 18:43:27 +02:00
Jonathan Puckey
373e14dd76
Improve CompoundPath documentation.
2011-05-27 13:54:34 +02:00
Jonathan Puckey
ca3230c1ad
Documentation: reorder functions, add group titles and todos.
2011-05-27 13:28:13 +02:00
Jürg Lehni
397d3676ed
Merge remote-tracking branch 'origin/master'
2011-05-26 21:00:05 +01:00
Jonathan Puckey
6b611add37
More documentation edits and function reordering.
2011-05-26 20:09:25 +02:00
Jonathan Puckey
65fa7fb01d
Path documentation: use Type[] for 'typed' arrays.
2011-05-26 16:50:13 +02:00
Jürg Lehni
8130ee458f
Rename #_countSelectedSegment() to #_updateSelection().
2011-05-26 11:52:28 +01:00
Jürg Lehni
3e7806ae50
Move #_countSelectedSegment().
2011-05-26 11:38:26 +01:00
Jürg Lehni
e31081f2fc
Use Path#_countSelectedSegment() in #removeSegments() as well.
2011-05-26 11:38:08 +01:00
Jürg Lehni
c67209f889
Optimize Curve#initialize for minifying.
2011-05-26 11:09:02 +01:00
Jürg Lehni
362eca7061
Further optimize Segment#initialize for minifying.
2011-05-26 11:08:07 +01:00
Jürg Lehni
d8fbca0d68
Shorten Segment#_changed().
2011-05-26 11:04:57 +01:00
Jürg Lehni
5b6bc1263c
Allow selection state of Segments to be changed before they are added to a Path (Part two of fixing selection cloning).
2011-05-26 10:59:22 +01:00
Jürg Lehni
2d218dbb19
Change and optimise the way SegmentPoints are created, so that selected state is actually copied over properly (Part one of fixing selection cloning).
2011-05-26 10:58:16 +01:00
Jonathan Puckey
26aa3c00d7
Add CurveLocation documentation.
2011-05-23 17:39:26 +02:00
Jonathan Puckey
0e63f11b72
Add Curve documentation.
2011-05-23 17:24:57 +02:00
Jonathan Puckey
a389be30cf
Add Path.Constructors documentation.
2011-05-23 14:33:22 +02:00
Jonathan Puckey
2a4f5b93f0
Path documentation: whitespace.
2011-05-23 13:37:40 +02:00
Jonathan Puckey
211635f206
Cleanup last commit.
2011-05-23 04:20:11 +02:00