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
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
25e5582a35
Define CompoundPath#reverse() and #clockwise, and replace reversePath() with it.
2013-05-03 21:41:22 -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
06ffd8089d
Fix issue in Path#removeSegments() where curves are removed wrongly when start index is 0.
...
Closes #200 .
2013-04-26 08:46:57 -07:00
Jürg Lehni
898e216668
Implement Path#getArea() and CompoundPath#getArea().
2013-04-25 17:37:19 -07:00
Jürg Lehni
d7e075d316
Handle contour edge cases in Path#contains().
...
Closes #208 .
2013-04-25 11:03:49 -07:00
Jürg Lehni
edfd8f53de
Remove accidentally committed debugging code.
2013-04-24 19:28:46 -07:00
Jürg Lehni
c70b9e7d7d
Fix issue with Path#strokeBounds with #strokeJoin == 'miter' and clockwise orientation.
...
Closes #206 .
2013-04-24 19:27:31 -07:00
Jürg Lehni
2fc4ff10ee
Implement Item#_contains() with local coordinates, and have Item#contains() take Item#matrix into account.
2013-04-21 08:43:05 -07:00
Jonathan Puckey
a5997dcc24
Add example to Item#contains(point) docs.
2013-04-21 13:56:29 +02:00
Jonathan Puckey
daf8d0f881
Rename 'properties' constructor parameter to 'object' in docs.
2013-04-21 13:54:31 +02:00
Jürg Lehni
db7eb65bd7
Implement Item#contains() and use it for hit-testing Rasters.
2013-04-20 20:41:52 -07:00
Jürg Lehni
bb03c72ce8
Implement Item#hasFill().
2013-04-20 20:40:20 -07:00
Jürg Lehni
e1807214f4
Large refactoring of Style handling for notable speed improvements.
2013-04-19 19:31:29 -07:00
Jürg Lehni
9da392a99c
Commit initial support for Shape class.
...
Hit testing is still missing.
2013-04-19 17:25:50 -07:00
Jürg Lehni
67203e753c
Move #applyMatrix setting to PathItem.
2013-04-19 13:16:00 -07:00
Jürg Lehni
8d99aa5f95
Handle color transformation in Item#transform() rather than Path#_applyMatrix().
...
Fixes an issue with BoucingBalls.html, now that CompoundPath#applyMatrix is true.
2013-04-19 13:13:54 -07:00
Jürg Lehni
922b9b5bd0
Rename _cloning parameter to _preserve.
2013-04-19 11:54:16 -07:00
Jürg Lehni
2e265693ff
Make #drawSelected() protected.
2013-04-18 17:50:53 -07:00
Jürg Lehni
d23e21edd7
Make Item#draw() protected, so we know to not directly call it.
2013-04-18 16:58:35 -07:00
Jürg Lehni
1333f59d54
Have CompoundPath always apply transformations by default.
2013-04-18 16:22:21 -07:00
Jürg Lehni
b55d89acda
Move handling of clipping outside of draw function, so canvas context can correctly be saved and restored for clipping paths too.
2013-04-09 19:08:41 -07:00
Jürg Lehni
fbe8a558bd
Refactor Format literal to Formatter class that keeps precision stored.
2013-04-09 17:32:19 -07:00
Jürg Lehni
9b50020721
Check for gradient Colors correctly.
2013-04-09 08:35:42 -07:00
Jürg Lehni
218732e320
Implement a row of simple optimizations to increase performance of Item constructors.
2013-04-07 17:36:09 -07:00
Jürg Lehni
a0b903e49c
Simply call slice() instead of slice(0).
2013-04-06 18:39:17 +02:00
Jürg Lehni
f43b322d2a
Rename Base#_type property to #_class.
2013-04-06 09:16:08 +02:00
Jürg Lehni
cb62c6053a
Switch back to persistence of segments for good.
2013-04-05 17:34:09 +02:00
Jürg Lehni
1392f87d85
Switch back to serializing segment lists for now, so we can fix other failing tests.
2013-03-19 18:48:59 -07:00
Jürg Lehni
5ff911f68c
Have Path#closePath() handle merging of first and last segment, if doubled.
...
So we finally found a reason for #closePath() to stick around :)
2013-03-19 18:47:18 -07:00
Jürg Lehni
3f634f6420
Use same precision in Path#getPathData() as everywhere else.
2013-03-19 16:23:36 -07:00
Jonathan Puckey
e5c32b9520
Actually fix handling of param.clip in Path#draw.
2013-03-17 21:59:07 +01:00
Jonathan Puckey
4c4258d2e1
Fix Raster#getAverageColor by having Path#draw clip the context, when param.clip is true.
2013-03-17 21:41:46 +01:00
Jonathan Puckey
4b87860b30
Add documentation of Path#getLocationOf
2013-03-16 18:39:53 +01:00
Jonathan Puckey
6f490d8b34
Add documentation for Path#split.
2013-03-16 17:59:31 +01:00
Jonathan Puckey
2d9b0b2e8e
Improve Path documentation.
2013-03-10 19:48:46 +01:00
Jonathan Puckey
177f799bde
Rename Path.Star parameter from numPoints to points.
2013-03-10 18:09:05 +01:00
Jonathan Puckey
2666e60f28
Fix Path#getTangentAt example.
2013-03-04 12:37:55 +01:00
Jonathan Puckey
2d103dd792
Improve and fix example documentation.
2013-03-04 12:09:58 +01:00
Jürg Lehni
8a69fcd1e5
Actually use precision setting in Path#getPathData().
2013-03-03 16:51:31 -08:00
Jonathan Puckey
7643085378
Path example documentation.
2013-03-03 20:48:03 +01:00
Jürg Lehni
1bfafee0ca
Use a default precision of three digits for exporting path data.
2013-03-02 08:14:17 -08:00
Jürg Lehni
67b1a602c4
Fix hit-testing of open filled Paths when they are part of a CompoundPath.
2013-03-01 21:47:13 -08:00
Jürg Lehni
03521796ef
Setting Path#selected to false should deselect all handles too.
2013-03-01 20:25:09 -08:00
Jürg Lehni
532176ac62
Fix drawing of selected handles.
2013-03-01 18:32:55 -08:00
Jürg Lehni
c543704115
Define Project#options as a way to configure things.
...
For now, only options.handleSize is in use.
2013-03-01 18:28:22 -08:00
Jürg Lehni
f0593c1fb9
Fix error with #getPathData() and empty paths.
2013-03-01 17:46:55 -08:00
Jürg Lehni
3f5d0a6925
Merge constructor._name with _type and use CamelCase for Item types.
2013-03-01 17:13:22 -08:00
Jürg Lehni
b649240696
Use correct defaults for #pathData serialization.
2013-02-28 19:55:18 -08:00
Jürg Lehni
cef30f9dd1
Switch to #pathData for JSON serialization of Path and CompoundPath.
2013-02-28 19:41:13 -08:00
Jürg Lehni
78b3621cf6
Implement PathItem#pathData getter and setter for SVG style path data.
...
And use it fro SvgImport too.
2013-02-28 19:14:06 -08:00
Jürg Lehni
6b7c6b6c4c
Implement Item#bounds.selected to control drawing of selected item bounds.
2013-02-24 15:41:31 -08:00
Jürg Lehni
119e5acbf9
Move #_setProperties() and #set() from Item to Base, rename it to #_set and use it for Tool too.
2013-02-15 18:28:49 -08:00
Jürg Lehni
24d467e292
Implement support for native dash strokes, through both setLineDash() and mozDash.
2013-02-12 15:32:21 -08:00
Jürg Lehni
489a785171
Override Item.extend() to merge the subclass' _serializeFields with the parent class' _serializeFields.
...
And have style fields always serialized in non-compact form for Color.
2013-02-11 17:08:23 -08:00
Jürg Lehni
b10454a83c
Rename Matrix#createInverse() to #inverted() and #createShiftless() to #shiftless().
2013-02-09 12:18:40 -08:00
Jürg Lehni
bc5826d324
Clean up code.
2013-02-08 18:46:22 -08:00
Jürg Lehni
dc35fdbd02
Move named inner functions out of nested scopes, to prepare for 'use strict;' transition.
2013-02-08 18:23:33 -08:00
Jürg Lehni
6c9c16ad3d
Update copyright information comments, and year.
2013-01-28 18:03:27 -08:00
Jürg Lehni
b0deda9445
Add missing documentation for various location related functions on Curve.
2013-01-28 16:47:45 -08:00
Jürg Lehni
1a438b8b9b
Change Curve#[getPoint / getTangent / getNormal](t) to #[getPoint / getTangent / getNormal](offset, isParamter).
...
Keep deprecated versions around for now.
2013-01-28 16:30:28 -08:00
Jürg Lehni
e75ee18de1
Restructure code a bit.
2013-01-22 14:58:34 -08:00
Jürg Lehni
a5bfa9e5d3
Remove debug logging for Segment / Curve insertion, deletion and splitting.
2013-01-22 14:54:19 -08:00
Jürg Lehni
f09bc84a12
Implement correct handling of Curves / Segments synchronization, improve CurveLocation linking to Curves through their linked Segments, and preserve Curves in Path#split() calls.
2013-01-22 14:46:49 -08:00
Jürg Lehni
4346563fe4
No need to merge Path#_serializeFields, simply keep in sync with Item#_serializeFields (excluding #children).
2013-01-20 14:01:43 -08:00
Jürg Lehni
49c8f8b6b5
A couple of improvements on Path#split().
2013-01-20 14:01:42 -08:00
Jürg Lehni
b04eb2b98f
Implement Path#split() and Curve#split().
2012-12-31 22:28:41 +01:00
Jürg Lehni
d2b799f4db
Fix various issues with Path#curves synchronization.
2012-12-31 22:21:50 +01:00
Jürg Lehni
f0038465cc
Fix clearing of removed segments.
2012-12-31 21:45:30 +01:00
Jürg Lehni
a10e44d601
Minor code clean-up.
2012-12-31 21:43:43 +01:00
Jürg Lehni
5a2be6d545
No need for chainable functions on Item types.
2012-12-31 21:42:14 +01:00
Jürg Lehni
d509f86e1a
Fix issue where removing segments from open paths would correct curves wrongly.
2012-12-31 21:19:55 +01:00
Jürg Lehni
5da4e89672
Return 'this' in more places to facilitate chained calls inside the library.
2012-12-31 20:07:28 +01:00
Jürg Lehni
4185b63d99
Und recent renaming of #getNearest*() methods.
2012-12-30 19:43:35 +01:00
Jürg Lehni
2abefee336
Merge Base.readValue() with Base.read() and rename Base.peekValue() to Base.peek().
...
When called directly on Base, read() reads values, otherwise the specific type of the subclass it is called on.
2012-12-30 16:07:20 +01:00
Jürg Lehni
1b539301ad
Find a better naming convention for the various getLocation* methods (*At for offsets / parameters, *Of for points), implement the missing methods on Curve and use them in Path.
2012-12-27 21:08:03 +01:00
Jürg Lehni
3c4978eb04
Rename Curve#getParameter(point) to Curve#getParameterOf(point), to better distinguish from Curve#getParameterAt(length).
2012-12-27 20:09:21 +01:00
Jürg Lehni
68ad4bb5ba
Implement PathItem#getIntersections(path) and Curve#getIntersections(curve) using divide-and-conquer approach, and new Curve.getBounds().
2012-12-27 19:23:03 +01:00
Jürg Lehni
75596e1d03
Move a part of Path.getBounds() code into Curve._addBounds(), and use it to also define Curve.getBounds().
2012-12-27 18:38:55 +01:00
Jürg Lehni
050ca1dcb1
Further clean up Path.getBounds() code.
2012-12-27 17:43:21 +01:00
Jürg Lehni
3a1f2eec3f
Restructure Path#getBounds() code so Curve bounds calculations can be moved to Curve.
2012-12-27 15:19:42 +01:00
Jürg Lehni
2673991620
Have Path#_serializeFields inherit from Item#_serializeFields.
2012-12-27 13:04:38 +01:00
Jürg Lehni
f45c04a359
Remove overridden Path#matrix getters and setters, since we now control behavior through #applyMatrix.
2012-12-27 13:04:07 +01:00
Jürg Lehni
4f83e0eee6
Commit first version of serialization / deserialization mechanism.
...
It appears to work fine already for Paths and Groups.
2012-12-27 12:45:55 +01:00
Jürg Lehni
ae4e5d4be5
Rename Item#setProperties() to hidden #_setProperties() and add public Item#set() to use same functionality from outside.
2012-12-27 00:52:09 +01:00
Jürg Lehni
3ac039bd66
Implement properties object literal initialization for all Item constructors.
2012-12-25 22:12:25 +01:00
Jürg Lehni
947afe85f0
Simplify Path#initialize() code.
2012-12-25 16:59:05 +01:00
Jürg Lehni
8f093f6dd7
Remove all PORT comments, since we won't port back features to Scriptographer.
2012-12-25 16:07:48 +01:00
Jürg Lehni
b54bdadaff
Rename Item#transformContent to #applyMatrix.
2012-12-24 17:39:24 +01:00
Jürg Lehni
d6fceb928f
Implement Item#transformContent property, which controls wether Item#transform() directly applies transformations to contents, or simply stores them in Item#matrix.
2012-12-24 00:39:42 +01:00
Jürg Lehni
e21ea457a7
Remove Item#apply() and clean up #applyMatrix() and simplify handling.
2012-12-24 00:29:09 +01:00
Jürg Lehni
734cc1cc61
Undo commit 4445376c0204cb5a2e408c64b77a5b6fa09305ba since it clashes with magnification.
2012-12-21 16:41:57 +01:00
Jürg Lehni
e10ef4dba3
Fix comment.
2012-12-19 03:22:57 +01:00
Jürg Lehni
4de5f30f72
Improve documentation.
2012-12-18 14:19:22 +01:00
Jürg Lehni
b535d9f843
Implement new Bootstrap feature that allows hiding of getter parameters to make sure beans are produced, and use it across the library.
2012-12-15 19:51:31 +01:00
Jürg Lehni
5a316c244b
Directly expose bounds methods as statics rather than using a private scope.
2012-12-15 08:27:37 -08:00
Jürg Lehni
0d2ed108e2
Refactor getBounds code so that functionality can be exposed as static methods on Path.
2012-12-15 08:19:10 -08:00
Jürg Lehni
021009abbc
Shorten Path#getBounds() code by using Numerical.solveQuadratic().
2012-12-15 07:58:20 -08:00
Jürg Lehni
9a7f72e163
Clean up getBounds code a bit, by using less local variables and more explicit variable names.
2012-12-14 21:40:25 -08:00
Jürg Lehni
2061cb0517
Fix Path#contains() for unclosed paths that have a fill color.
2012-12-14 21:39:47 -08:00
Jürg Lehni
9d8bf12028
Never return null from #getBounds.
2012-12-09 18:00:23 -08:00
Jürg Lehni
d16155f4fe
Fix CompoundPath#clone() so that it does not alter the #clockwise state on its children.
2012-12-01 11:31:03 -08:00
Jürg Lehni
ace1d0f441
No need to set _clockwise since #reverse() already does so.
2012-12-01 11:10:59 -08:00
Jürg Lehni
d0cc8b6c16
Fix issue with hit-testing filled paths that are not closed.
2012-11-28 22:13:31 -08:00
Jürg Lehni
4d51173881
Keep Path#curves in sync properly when removing the last segment of an open path.
...
Closes #138 .
2012-11-23 13:58:13 -08:00
Jürg Lehni
61b6026361
Rename CompoundPath#flatten() to #reduce(), to avoid clash with Path#flatten().
2012-11-23 01:16:21 -08:00
Ben Firshman
8ca26f650a
Fixed leaky _handle2
2012-11-20 15:53:31 +00:00
Jürg Lehni
1cb6a7fc3c
Clean up Path#smooth() code a bit.
2012-11-06 20:18:59 -08:00
Jürg Lehni
f110038104
Improve clipping mask drawing, and remove some unneeded ctx.save() / ctx.restore() calls.
2012-11-06 20:14:21 -08:00
Jürg Lehni
fd8fe9c08e
Rename CompoundPath#simplify() to #flatten() to avoid clashes with Path#simplify(), and add Path#flatten(), returning itself.
2012-11-06 10:16:03 -08:00
Jürg Lehni
6e0f29bf4a
Rename Path#closed getter to #isClosed() instead of #getClosed().
2012-11-05 21:06:47 -08:00
Jürg Lehni
35568c15f2
Implement transparent constant-substitution in prepro.js to shave of some extra bytes of final distribution file.
2012-11-05 18:11:44 -08:00
Jürg Lehni
1050e3314e
Implement Segment#isLinear() and Path#isPolygon().
2012-11-04 00:03:49 -07:00
Jürg Lehni
19d145f281
Introduce Item#type, returning a simple item type string identifier.
2012-11-03 23:43:18 -07:00
Jürg Lehni
07c0b6ce6a
Improve Path#moveTo behavior()
...
Allowing it to be called multiple times before any other drawing commands.
2012-11-03 19:45:02 -07:00
Jürg Lehni
b22ff5ecca
Revert a recent change in selection handling.
2012-11-02 16:27:59 -07:00
Jürg Lehni
f73717a7e7
Fix issues in Numerical.solveQuadratic(), solveCubic() and Path#contains().
...
Closes #71 .
2012-10-22 18:21:33 -04:00
Jürg Lehni
317fcf5432
Only include strokeWidth in roughBounds if a strokeColor is actually set.
2012-10-20 16:01:53 -04:00
Jürg Lehni
f87eadecda
Correct default value for clockwise in arcTo().
2012-10-19 09:18:10 -04:00
Jürg Lehni
6441a682a8
Fix new error in quadraticCurveTo().
...
We don't seem to have test-cases for these yet.
2012-10-18 14:29:53 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
571ca31dbf
Move ctx.restore() to same level as ctx.save(). Closes #51 .
2011-09-18 10:56:04 +02:00
Jürg Lehni
7e0307dd6a
Correct comments.
2011-08-16 13:36:58 +02:00
Jürg Lehni
a8c08b3301
Docs: Document Path#getNearestLocation() and #getNearestPoint().
2011-08-01 11:48:27 +01: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
254aee47f8
Implement Path#getLocation(point)
2011-07-09 17:12:27 +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
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
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
Jürg Lehni
23c4499d15
Add comments about how to potentially improve getBounds() accuracy.
2011-07-07 23:00:40 +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
64ae48af0b
Remove solved TODO.
2011-07-07 16:10:06 +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
b13c7622c8
Rename Curve#getParameter(length) -> Curve#getParameterAt(offset)
2011-07-06 23:13:38 +02:00
Jürg Lehni
d6b666024b
Define #getNearestLocation() / #getNearestPoint() for Path.
2011-07-06 22:25:20 +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
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
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
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
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