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
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
218732e320
Implement a row of simple optimizations to increase performance of Item constructors.
2013-04-07 17:36:09 -07: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
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
Jonathan Puckey
e3760afecd
Fix handling of param.clip in CompoundPath#draw.
2013-03-17 22:27:20 +01:00
Jonathan Puckey
fa861f2047
Improve example documentation.
2013-03-03 20:10:25 +01: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
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
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
6c9c16ad3d
Update copyright information comments, and year.
2013-01-28 18:03:27 -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
22ddd7a37e
Implement CompoundPath#curves.
2012-12-18 14:53:38 +01: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
61b6026361
Rename CompoundPath#flatten() to #reduce(), to avoid clash with Path#flatten().
2012-11-23 01:16:21 -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
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
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
19d145f281
Introduce Item#type, returning a simple item type string identifier.
2012-11-03 23:43:18 -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
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
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
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
Jürg Lehni
79c0ad8cc5
Update copyright notices.
2011-07-01 12:17:45 +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
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
c1fcd6f3bb
Documentation: Convert more Array return types to Type[].
2011-06-20 14:27:54 +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
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
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