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
9efbc288a1
Merge Path.Rectangle and Path.RoundRectangle.
2013-04-19 12:36:49 -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
9ee8590a4d
Move Item.draw() to Item#draw().
...
Makes more sense this way.
2013-04-18 17:04:06 -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
9fe1ff951a
Clean up code.
2013-04-09 20:36:38 -07:00
Jürg Lehni
7f245974e6
Implement a faster method to filter out beginnings of intersected curves.
2013-04-09 20:35:31 -07:00
Jürg Lehni
a9a0857ba4
Find a better strategy to avoid duplicate solutions in PathItem#getIntersections().
...
Closes #197 .
2013-04-09 20:27:55 -07:00
Jürg Lehni
0f19e72733
Minor tweaks.
2013-04-09 19:12:47 -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
d3bb68d0e0
Use faster Array construction.
2013-04-09 07:55:09 -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
fa143ad545
Fix typo.
2013-04-07 09:49:34 -07:00
Jürg Lehni
a0b903e49c
Simply call slice() instead of slice(0).
2013-04-06 18:39:17 +02:00
Jürg Lehni
18ed9010a6
Derive Item#type from Item#_class and use that instead in code that depends on Item types.
2013-04-06 18:07:30 +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
Jürg Lehni
e854254986
Insert linear segments when dividing linear curves.
2013-03-19 16:17:12 -07:00
Jonathan Puckey
e3760afecd
Fix handling of param.clip in CompoundPath#draw.
2013-03-17 22:27:20 +01: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
4292b90bd4
Improve Segment documentation.
2013-03-10 19:48:28 +01:00
Jonathan Puckey
38b9b327ae
Add Path.Constructor examples.
2013-03-10 19:09:09 +01:00
Jonathan Puckey
177f799bde
Rename Path.Star parameter from numPoints to points.
2013-03-10 18:09:05 +01:00
Jonathan Puckey
097a9c958f
Rename Path.RegularPolygon parameter from numSides to sides.
2013-03-10 18:02:16 +01:00
Jürg Lehni
97e85d66db
Fix issue with object literal properties being accidentally misread as path segments.
...
Closes #177 .
2013-03-05 00:28:21 -08: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
849d3efc2e
Have PathItem#setPathData() clear the previous content.
2013-03-03 16:56:48 -08:00
Jürg Lehni
8a69fcd1e5
Actually use precision setting in Path#getPathData().
2013-03-03 16:51:31 -08:00
Jürg Lehni
7b7168feb1
Fix reading of rectangle in Path.Constructor.
...
And all tests are green again.
2013-03-03 15:29:15 -08:00
Jonathan Puckey
7643085378
Path example documentation.
2013-03-03 20:48:03 +01:00
Jonathan Puckey
fa861f2047
Improve example documentation.
2013-03-03 20:10:25 +01:00
Jonathan Puckey
801eb0f2a8
Add example to Segment#selected docs.
2013-03-03 20:09:41 +01:00
Jonathan Puckey
3cdb11fe36
GradientStop & PathItem example documentation.
2013-03-03 19:47:32 +01:00
Jonathan Puckey
09e4bd0bb4
Improve Path.Constructors example documentation.
2013-03-03 18:34:39 +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
936b1bccbb
Get curves uncached in CurveLocation#split() and #divide().
2013-03-01 20:26:03 -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
dfe1a7efab
Define setter for Segment#linear.
2013-03-01 20:24:46 -08:00
Jürg Lehni
2230c2888d
Fix issue with Curve#divide() where the wrong curve reference is returned.
2013-03-01 20:19:44 -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
7553712e35
Simplify code for readRectangle() in Path.Constructors.
2013-03-01 14:39:26 -08:00
Jürg Lehni
3f85dcdb77
Use #_set() in Rectangle#initialize() to simplify code and increase flexibility.
2013-03-01 14:37:27 -08:00
Jürg Lehni
8d2c2f5fda
Fix an issue with PathFitter where path with only one segment would throw an error.
...
Closes #175 .
2013-03-01 14:28:32 -08:00
Jürg Lehni
7405858f32
Simplify code for reading of named arguments, removing the need for filtering arguments by using 'in' checks instead for the presence of properties / setters.
2013-03-01 14:06:04 -08:00
Jürg Lehni
06e33ba412
Improve flexibility of reading rectangles in Path.Constructor.
...
We can now define the rectangle by any property that it has setters for.
2013-03-01 13:52:11 -08:00
Jürg Lehni
12d4d563d9
Further shorten path data code.
2013-03-01 01:18:42 -08:00
Jürg Lehni
13a567bcaa
Fix handling of multiple h / v commands in path data.
2013-03-01 01:18:27 -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
5fbc6e939d
Fix small SVG path-data parser issue.
2013-02-28 19:33:08 -08:00
Jürg Lehni
82cefa9846
Fix typo.
2013-02-28 19:29:44 -08:00
Jürg Lehni
0f140e391d
Minor clean ups.
2013-02-28 19:21:46 -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
9d8cddbe42
Implement new private Format object that handles formatting of number, point, size and rectangle.
2013-02-28 19:14:05 -08:00
Jürg Lehni
79e836373d
Clean up hitTest code a little.
2013-02-25 15:41:31 -08:00
Jürg Lehni
cd9184a6f0
Fix CompoundPath hit-testing.
2013-02-24 19:01:29 -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
0a81787c7e
Fix a bug in CompoundPath#hitTest().
...
Results from Path#hitTest() were not passed through.
2013-02-24 14:56:28 -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
23b51915eb
Implement CompoundPath#firstSegment, #lastSegment, #firstCurve and #lastCurve.
2013-02-15 18:05:16 -08:00
Jürg Lehni
d3ccec2256
Use the code from Group#isEmpty() and CompoundPath#isEmpty() for Item#isEmpty(), since any item that does not have children overrides it.
2013-02-15 18:01:23 -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
fdd15e675f
Add options argument to #toJson() methods, and use to implement optional fractional digit precision control.
2013-02-12 14:57:54 -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
1ee29d56ac
Improve comment about JavaScriptCore bug.
2013-02-08 16:35:33 -08:00
Jürg Lehni
b6d2d83af5
Fix the strangest JavaScriptCore bug that I've encountered in ages.
...
Closes #168 . Read comment for more details.
2013-02-08 16:32:47 -08:00
Jürg Lehni
02ca95eb46
Avoid accidental global leakage.
2013-02-08 16:12:57 -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
c7d8aebb9e
Swap Curve's bounds scope with point evaluation scope, for proximity to bounds related methods in scope before.
2013-01-28 16:32:04 -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
e4d98f7865
Add internal _cloning parameter to all insertion methods.
2013-01-20 16:14:30 -08:00
Jürg Lehni
677ea374c5
Only change #clockwise on closed Paths when inserting into CompoundPaths.
2013-01-20 15:48:06 -08:00
Jürg Lehni
c5ede2e955
Add support for _setProperties() to CompoundPath constructor.
2013-01-20 15:20:10 -08:00
Jürg Lehni
ba5aa86411
Include Roger Willcocks in the thanks regarding isSufficentlyFlat.
2013-01-20 14:28:02 -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
b05a21d6c9
Fix bug in Curve#getLocationOf().
2013-01-20 14:01:42 -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
8cea919dbd
Calculate CurveLocation#parameter uncached when dealing with dividing or splitting, since these commands alter the underlying Path.
2012-12-31 21:42:55 +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
8ec8af4dc5
Define CurveLocation#divide().
2012-12-30 19:53:09 +01:00
Jürg Lehni
e066db4577
Implement Curve#divide().
2012-12-30 19:49:17 +01:00
Jürg Lehni
4185b63d99
Und recent renaming of #getNearest*() methods.
2012-12-30 19:43:35 +01:00
Jürg Lehni
4ab9a942b0
Clean up Path.Constructor code.
2012-12-30 18:33:46 +01:00
Jürg Lehni
a1fc86b19e
Add forgotten passing on of arguments._filtered.
2012-12-30 18:29:01 +01:00
Jürg Lehni
4e20a5794f
Remove debug logging.
2012-12-30 18:27:42 +01:00
Jürg Lehni
8bed8cb15d
Define mechanism for flexible reading of named arguments through Base.readNamed() and Base.hasNamed(), and use it to implement property object literal versions of Path.Constructor code.
2012-12-30 18:24:33 +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
231369fa01
Shorten code a bit, using loops.
2012-12-27 20:46:12 +01:00
Jürg Lehni
cb8f3291d3
Clean up some comments.
2012-12-27 20:19:23 +01:00
Jürg Lehni
5b9d33f32e
Fix imprecision in intersection code by re-introducing tolerance parameter in Curve#isFlatEnough().
2012-12-27 20:13:45 +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
00898908d3
Write documentation for PathItem#getIntersections().
2012-12-27 19:26:40 +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
03b5d58e79
Merge branch 'refs/heads/master' into intersection
2012-12-27 18:43:43 +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
57a9f4fc91
Use constant substitution for Numerical constants as well.
2012-12-27 18:36:59 +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
c025c41ec0
Start implementing PathItem#getIntersections().
2012-12-21 16:13:38 +01:00
Jürg Lehni
d43cc28aac
Optimise Curve constructors that construct from 4 arguments (points) and 8 (coordinate values).
2012-12-20 18:03:11 +01:00
Jürg Lehni
e10ef4dba3
Fix comment.
2012-12-19 03:22:57 +01:00
Jürg Lehni
22ddd7a37e
Implement CompoundPath#curves.
2012-12-18 14:53:38 +01:00
Jürg Lehni
29a2bc781b
Implement the various bounds getter on Curve too, using caching and the new static Path.get*Bounds methods.
2012-12-18 14:35:21 +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
09ee9a0689
Exclude 1 in parameter range for crossing counting, as segment points would be counted twice otherwise.
2012-12-15 02:27:36 -08:00
Jürg Lehni
16578e6b15
Clean up code.
2012-12-15 02:24:46 -08:00
Jürg Lehni
a36d244eb1
Handle impression in Curve#getCrossings(), causing wrong results when handling circles.
2012-12-15 01:52:23 -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
f14b685c1d
Use #_type comparisson rather than slower instanceof operator wherever we can.
2012-12-01 11:17:09 -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
Ben Firshman
73d6c102a6
Fix k leaking into globals
2012-11-20 15:53:04 +00:00
Ben Firshman
dc1161b32a
Fix fullLength leaking into globals
2012-11-20 15:53:03 +00:00
Jürg Lehni
d671a08205
Introduce Base.toFloat() and rename Base.formatNumber() to Base.formatFloat()
2012-11-14 01:31:08 -08:00
Jürg Lehni
e9a9066d7f
Use group creation without explicit array declaration, as that's been supported all along.
2012-11-06 20:37:50 -08: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
4b6207bdb6
Do not allow adding of items other than paths to CompoundPath.
2012-11-06 14:01:52 -08:00
Jürg Lehni
28642bd1c8
Rename Path.Oval() to Path.Ellipse(), and deprecate Path.Oval().
2012-11-06 11:37:00 -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
Jonathan Puckey
33c13b36a3
Fix drawing of groups where a compound path is used as a clip mask.
2012-11-06 18:07:51 +01:00
Jürg Lehni
4c51544b6e
Implement correct checks for primitives (rect, ellipse, circle).
2012-11-06 01:22:16 -08:00
Jürg Lehni
64b9daacd0
Code clean-up.
2012-11-05 21:06:56 -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
400b454177
Introduce Numerical.isZero(), for comparisons against 0 with a tolerance.
2012-11-05 21:06:13 -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
6ed1d67ada
Modernize Bootstrap.js, introduce Base.create() and use it instead of the Constructor.dont hack for object creation without the calling of initialize.
2012-11-03 21:49:37 -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
1ce332756e
Rename ImportSvg to SvgImporter, and ExportSvg to SvgExporter.
2012-11-02 17:40:07 -07:00
Jürg Lehni
ab02023adf
Do not create extra points when asked to produce a round rectangle with no radius.
2012-11-02 17:04:21 -07:00
Jürg Lehni
b22ff5ecca
Revert a recent change in selection handling.
2012-11-02 16:27:59 -07:00
Jürg Lehni
f6f80e4061
Implement CompoundPath#contains() and #hitTest() correctly.
...
And change the way that styles are stored on CompoundPaths: Not in the first child but in the item itself.
2012-10-22 18:48:51 -04: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
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