Commit graph

1401 commits

Author SHA1 Message Date
Jonathan Puckey
0a27879a23 Add KeyEvent documentation. 2011-05-23 19:56:18 +02:00
Jonathan Puckey
93b06f3acb Add PlacedSymbol documentation. 2011-05-23 19:48:48 +02:00
Jonathan Puckey
de7926990b Add CharacterStyle documentation. 2011-05-23 19:28:55 +02:00
Jonathan Puckey
de76b063b9 Add ParagraphStyle documentation. 2011-05-23 19:24:33 +02:00
Jonathan Puckey
50e996aa43 Add PointText documentation. 2011-05-23 19:13:51 +02:00
Jonathan Puckey
24689300c3 Add TextItem documentation. 2011-05-23 18:56:13 +02:00
Jonathan Puckey
5bd935be75 Symbol documentation & move Symbol#clone below Symbol#setDefinition. 2011-05-23 18:29:44 +02:00
Jonathan Puckey
14c693aa7c Add Project documentation. 2011-05-23 18:13:03 +02:00
Jonathan Puckey
e66e8e330b Point: whitespace. 2011-05-23 18:04:08 +02:00
Jonathan Puckey
65ee63546d Add Key documentation. 2011-05-23 18:02:46 +02: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
08f6f94fb6 Clean up whitespace in Item documentation. 2011-05-23 17:10:12 +02:00
Jonathan Puckey
dc66049312 Documentation: small adjustment to Item#clone 2011-05-23 17:07:35 +02:00
Jonathan Puckey
d0ecd6a4ad Layer: small edit to constructor docs. 2011-05-23 17:02:22 +02:00
Jonathan Puckey
59af5343b5 Add Layer documentation. 2011-05-23 17:00:37 +02:00
Jonathan Puckey
ca35b3fe60 Add Tool documentation. 2011-05-23 16:54:51 +02:00
Jonathan Puckey
8c688bf83d Merge ToolHandler with Tool and remove ToolHandler. 2011-05-23 16:30:18 +02:00
Jonathan Puckey
872fbe1574 Document some more Raster functions. 2011-05-23 16:19:37 +02:00
Jonathan Puckey
04e34128ae Fix Raster#visible default value. 2011-05-23 16:18:59 +02:00
Jonathan Puckey
53d7a1e914 Add Raster documentation. 2011-05-23 16:09:04 +02:00
Jonathan Puckey
a389be30cf Add Path.Constructors documentation. 2011-05-23 14:33:22 +02:00
Jonathan Puckey
3d1317cece Item docs: change order of removeOn documentation. 2011-05-23 13:47:21 +02:00
Jonathan Puckey
2a4f5b93f0 Path documentation: whitespace. 2011-05-23 13:37:40 +02:00
Jonathan Puckey
a988f1b7a2 Matrix documentation: whitespace. 2011-05-23 13:37:26 +02:00
Jonathan Puckey
c4f53cf297 Group documentation. 2011-05-23 13:37:13 +02:00
Jonathan Puckey
3247527c8d Documentation: Add @lends to ToolHandler to stop it bleeding into the ToolEvent documentation. 2011-05-23 04:38:30 +02:00
Jonathan Puckey
a5bf23e33e Add ToolEvent documentation. 2011-05-23 04:37:50 +02:00
Jonathan Puckey
211635f206 Cleanup last commit. 2011-05-23 04:20:11 +02:00
Jonathan Puckey
6db1f6c54c Documentation: ignore various classes. 2011-05-23 04:18:21 +02:00
Jonathan Puckey
66c521602d Size: make @lends point to Size. 2011-05-23 04:12:39 +02:00
Jonathan Puckey
987ac5b8f7 Adjust PathStyle constructor documentation. 2011-05-23 03:47:39 +02:00
Jonathan Puckey
c3246a969c PathStyle documentation: rename Document to Project. 2011-05-23 03:43:49 +02:00
Jonathan Puckey
548a2983fb Add PathStyle documentation. 2011-05-23 03:41:20 +02:00
Jonathan Puckey
08ea1391b5 Add Size documentation. 2011-05-23 03:13:17 +02:00
Jonathan Puckey
539c80b028 Documentation: Point math functions. 2011-05-23 03:12:14 +02:00
Jonathan Puckey
f3e118ac9a Documentation: Point#equals 2011-05-23 03:11:53 +02:00
Jonathan Puckey
460101c55e More Point documentation. 2011-05-23 02:33:01 +02:00
Jonathan Puckey
349e4023f3 CompoundPath documentation: adjust constructor docs. 2011-05-23 01:53:57 +02:00
Jonathan Puckey
ae6606e11c Add CompoundPath docs. 2011-05-23 01:49:01 +02:00
Jonathan Puckey
7ffd8445b7 Add Rectangle documentation. 2011-05-23 01:36:16 +02:00
Jonathan Puckey
021c23a84c Move Point#x and Point#y docs outside of the constructor. 2011-05-23 01:34:30 +02:00
Jonathan Puckey
41c47449c1 Make Matrix docs jsdoc compatible. 2011-05-23 00:54:27 +02:00
Jonathan Puckey
b366829cef Improve Point docs. 2011-05-23 00:50:56 +02:00
Jonathan Puckey
06a6d5cc70 Add documentation to Segment. 2011-05-23 00:42:22 +02:00
Jonathan Puckey
5cea863ccb Add documentation to Path. 2011-05-23 00:26:08 +02:00
Jonathan Puckey
8522a4485e Add documentation for Item. 2011-05-22 23:39:54 +02:00
Jonathan Puckey
85d4af5154 Point documentation: add types to bean properties. 2011-05-22 22:55:34 +02:00
Jonathan Puckey
ef184db13a Point: {Boolean} -> {boolean} and {Number} -> {number} 2011-05-22 18:57:10 +02:00
Jonathan Puckey
6a9124dd9a Make Point documentation jsdoc compatible. 2011-05-22 18:47:20 +02:00
Jonathan Puckey
1a8e81bc22 Project#selectAll: remove todo. 2011-05-21 21:41:10 +02:00
Jonathan Puckey
469f72d36f Remove todo. 2011-05-21 21:39:27 +02:00
Jonathan Puckey
08f3ac197b Symbol#setDefinition: fix accidental beans access and add comment. 2011-05-21 21:33:43 +02:00
Jonathan Puckey
2f7a98f7d6 Have Symbol#setDefinition deselect the passed item. 2011-05-21 21:32:26 +02:00
Jonathan Puckey
7cdacc5536 Optimize Segment#initialize for minification. 2011-05-21 19:21:13 +02:00
Jonathan Puckey
572b62590e Fix Raster#clone. 2011-05-21 18:02:09 +02:00
Jonathan Puckey
f2e01a8837 Color: Rename variable name due to conflict. 2011-05-21 17:56:54 +02:00
Jonathan Puckey
81558cb54f Avoid double lookup of component key. 2011-05-21 17:49:54 +02:00
Jonathan Puckey
f3deed81cd Optimize Color#initialize for minifying. 2011-05-21 17:40:29 +02:00
Jonathan Puckey
f83d16906c Clone the color when calling Color#convert with the same color type. 2011-05-21 17:37:36 +02:00
Jonathan Puckey
e5034a5a76 Color#clone: don't initialize when calling 'new this.constructor'. 2011-05-21 17:35:37 +02:00
Jonathan Puckey
024e8eb19b Fix Color cloning by adding clone function and using it in Color#initialize. 2011-05-21 17:13:25 +02:00
Jürg Lehni
816424a9c5 Merge remote-tracking branch 'origin/master'
Conflicts:
	test/lib/helpers.js
2011-05-21 14:41:08 +01:00
Jürg Lehni
b3281806a3 No need to check if _style is defined now since even Layer (ineriting from Group) now has a style. 2011-05-21 14:29:00 +01:00
Jürg Lehni
a51957bf64 Change PathStyle to clone values in setters if they provide a clone function. This requires also using equals() wherevere they are checked to be the same or different. 2011-05-21 14:28:08 +01:00
Jürg Lehni
2b5d648e96 Change SegmentPoint.create() to copy over selected state from a provided other point or object. 2011-05-21 14:27:29 +01:00
Jonathan Puckey
73a2f0f256 Implement Raster#clone. 2011-05-21 12:50:02 +02:00
Jonathan Puckey
46b1311260 Gradient#equals: also check gradient type. 2011-05-21 12:06:37 +02:00
Jonathan Puckey
d8b73f3671 Fix GradientColor#clone(). 2011-05-21 12:06:01 +02:00
Jürg Lehni
b461368b18 Found a clean way for Layer#initialize() to call this.base() too, without implicitely calling paper.project.activeLayer.appendTop. 2011-05-21 01:05:22 +01:00
Jürg Lehni
9f1172f24a Merge remote-tracking branch 'origin/master' 2011-05-21 00:59:19 +01:00
Jürg Lehni
f6e827cfd1 Allow Color#alpha to be set to null. 2011-05-21 00:41:04 +01:00
Jürg Lehni
7e7944e6f4 Fix recently introduced error in Color, by setting internal properties directly. 2011-05-21 00:40:20 +01:00
Jonathan Puckey
8a1b1041cd Make PointText#matrix 'private' by renaming to _matrix. 2011-05-20 22:03:16 +02:00
Jonathan Puckey
f676cc026f Add TextItem#_clone to copy over characterStyle and paragraphStyle. 2011-05-20 21:33:25 +02:00
Jonathan Puckey
2c94b4270a Fix ParagraphStyle.create(item). 2011-05-20 21:29:47 +02:00
Jonathan Puckey
fc3833f150 Fix PlacedSymbol#clone(). 2011-05-20 19:41:53 +02:00
Jonathan Puckey
64a142436b Tests: add item cloning tests. 2011-05-20 19:40:07 +02:00
Jonathan Puckey
013fe56ea4 Item#_clone: check if the item has a _pathStyle property before copying it. 2011-05-20 19:35:26 +02:00
Jürg Lehni
84b1d865c1 Remove unused variable. 2011-05-20 14:08:04 +01:00
Jürg Lehni
be63d2cf07 Remove empty line. 2011-05-20 14:04:35 +01:00
Jürg Lehni
631923669a Eliminate some of the TODOs. 2011-05-20 14:00:27 +01:00
Jürg Lehni
0a87eef244 Add comment about PointText#matrix and #point being exposed. 2011-05-20 08:56:14 +01:00
Jürg Lehni
ec0484e798 Define Symbol#clone(), needs testing. 2011-05-20 08:55:44 +01:00
Jürg Lehni
5713bc07f2 Define PlacedSymbol#clone(), needs testing. 2011-05-20 08:55:35 +01:00
Jürg Lehni
b15eecc34d Use new internal Item#_clone() to improve Path#clone() and PointText#clone(). 2011-05-20 08:54:44 +01:00
Jürg Lehni
87d340e525 Introduce private Item#_clone(copy), so subclasses can override the way the copy is actually produced, e.g. providing parameters to the constructor. 2011-05-20 08:50:09 +01:00
Jürg Lehni
fd8ceb9641 Implement PointText#clone(), untested. 2011-05-20 08:47:13 +01:00
Jürg Lehni
4ceaca00f4 Initialise content to empty string, so content += 'something' would not produce odd results. 2011-05-20 08:46:58 +01:00
Jürg Lehni
e7cad9b134 Use local point in translate, as it is not a LinkedPoint and won't require beans access. 2011-05-20 08:46:17 +01:00
Jürg Lehni
01f26c4be0 Restructure line break. 2011-05-20 08:40:35 +01:00
Jürg Lehni
131425a12f Rely on #_transform() in #setPoint() as it already handles updating of #_point for us and all. 2011-05-20 08:33:19 +01:00
Jürg Lehni
2e82ac97d8 Convert PointText#point to a LinkedPoint so direct changes to it get noticed too. 2011-05-20 08:32:36 +01:00
Jürg Lehni
d6a49e2eb4 No need to check result of Point.read(), as it will always be a Point (_readNull is only defined for Color). 2011-05-20 08:28:49 +01:00
Jürg Lehni
4153bc0fbf Fix bug in PointText#_transform(), where wrong version of matrix._transformPoint() was applied to _point, resulting in no transformation. 2011-05-20 08:27:11 +01:00
Jürg Lehni
10dadb80f2 Move isHue check outside of setter. 2011-05-20 08:08:26 +01:00
Jürg Lehni
1c479f315e Add some comments to Item#clone(). 2011-05-19 22:09:51 +01:00
Jürg Lehni
8a8c68b3d6 Define #clone() for various Gradient classes. Needs testing. 2011-05-19 22:02:26 +01:00
Jürg Lehni
38ddd34589 Replace beans access with internal property. 2011-05-19 22:00:03 +01:00
Jürg Lehni
276eb3301e Define scafold #clone() function for the classes that still required a proper definition. 2011-05-19 21:56:49 +01:00
Jürg Lehni
7401e42316 Implement #clone() for Item, Group and Path. Needs testing. 2011-05-19 21:56:23 +01:00
Jürg Lehni
b52abbfbc1 Replace removed 'hidden' property with 'visible'. 2011-05-19 21:55:51 +01:00
Jürg Lehni
2dcb09a662 Define Path#clone(). 2011-05-19 21:34:19 +01:00
Jürg Lehni
6348f94362 Optimise Gradient constructor. 2011-05-19 20:54:52 +01:00
Jürg Lehni
8eea7e15d4 Give GradientStop a proper #initialize() function and use GradientStop.readAll() in Gradient#setStops() with some added magic to automatically assign rampPoints if they were not specified. 2011-05-19 20:51:09 +01:00
Jürg Lehni
fcb8242da8 Restructure #initialize() in basic types to use direct arguments checking more than arguments.length. 2011-05-19 20:37:04 +01:00
Jürg Lehni
404e61ebff Remove deleted files from load.js and paper.js. 2011-05-19 20:28:45 +01:00
Jürg Lehni
6685d09801 Add missing semicolon. 2011-05-19 20:21:42 +01:00
Jürg Lehni
ef4e80ecef Replace getter calls with direct access of internal properties. 2011-05-19 20:21:22 +01:00
Jürg Lehni
a035f645fc Replace unneeded beans access with local variable. 2011-05-19 20:20:32 +01:00
Jürg Lehni
1473d82456 Variable chaining. 2011-05-19 20:20:01 +01:00
Jürg Lehni
32fb1b065e No need to check for colorType since #convert() already performs this optimisation. 2011-05-19 20:19:36 +01:00
Jürg Lehni
3b9369fafb Handle special setter for hue in Color.extend() as well, and move defintion of various Color classes to Color file since they are one-liners now. 2011-05-19 19:00:36 +01:00
Jürg Lehni
57b194e047 Add explaining comments to Raster#getAverageColor() code. 2011-05-19 18:51:13 +01:00
Jürg Lehni
e8d4a16ab2 Shorten Raster#getAverageColor(). 2011-05-19 18:47:49 +01:00
Jürg Lehni
b103af4216 Merge remote-tracking branch 'origin/master' 2011-05-19 18:35:45 +01:00
Jürg Lehni
09612c4623 Remove the versions of #clone() that follow the scheme provided by Base#clone() now. 2011-05-19 18:35:38 +01:00
Jürg Lehni
b37ba3d858 Add a generic clone() method to all classes through Base which creates a new item using the constructor and passing 'this'. 2011-05-19 18:34:22 +01:00
Jonathan Puckey
f965e53a06 Optimize Path#getAverageColor 2011-05-19 15:43:23 +02:00
Jonathan Puckey
df15cf6970 Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-19 15:41:34 +02:00
Jürg Lehni
ac213e94b4 Fix bug introduced in recent change to #getStrokeBounds(): We need to pass matrix as optional argument to #getBounds(). 2011-05-18 21:32:00 +01:00
Jürg Lehni
106719597b Further simplify Color code by moving components definitions to one object. 2011-05-18 21:21:28 +01:00
Jürg Lehni
a17f7865a3 Simplify Color subclass construction by moving beans producing code into an extended Color.extend() function that handles it for us. 2011-05-18 21:11:59 +01:00
Jürg Lehni
dfc6a05969 Shorten some converters a bit. 2011-05-18 20:40:52 +01:00
Jürg Lehni
9b95ba095c Don't capitalize twice. 2011-05-18 20:37:09 +01:00
Jürg Lehni
d643ac7626 Less cryptic code without Base.each() side-car makes more sense here. 2011-05-18 20:36:24 +01:00
Jürg Lehni
2367cfa6f2 Simplify Color code by merging all injection scopes to one. 2011-05-18 20:35:18 +01:00
Jonathan Puckey
e8cf29fd6c Size#min and Size#max: fix capitalization. 2011-05-18 21:31:02 +02:00
Jonathan Puckey
0a385d56a7 Replace accidental beans access with direct access of internal property. 2011-05-18 20:22:57 +02:00
Jonathan Puckey
b4807b9b7c Fix Path#getStrokeBounds: use Path#getBounds when no strokeColor or strokeWidth are set. 2011-05-18 20:08:10 +02:00
Jürg Lehni
cca4a44d03 Merge remote-tracking branch 'origin/master' 2011-05-18 15:44:33 +01:00
Jürg Lehni
86ca1ed1e7 Add comment explaining color conversion code. 2011-05-18 15:37:01 +01:00
Jonathan Puckey
241d98a1cf Merge remote branch 'origin/master' 2011-05-18 16:01:36 +02:00
Jonathan Puckey
8810563a8f Improve Raster#getAverageColor. 2011-05-18 16:00:55 +02:00
Jürg Lehni
93d3214a35 Fix porting error in GradientStop. 2011-05-18 10:04:46 +01:00
Jürg Lehni
db1a25933a Replace accidental beans access with direct access of internal property. 2011-05-18 09:43:32 +01:00
Jürg Lehni
88332d763d Simplify GradientColor#equals(). 2011-05-18 09:42:09 +01:00
Jürg Lehni
57eabed874 Simplify GradientStop#equals(). 2011-05-18 09:40:03 +01:00
Jürg Lehni
8b2709f5d8 Replace accidental beans access with direct access of internal property. 2011-05-18 09:38:45 +01:00
Jürg Lehni
eb6b838cf4 Simplify GradientStop#setRampPoint(). 2011-05-18 09:38:20 +01:00
Jürg Lehni
fc52944ee8 Change method sequence a bit. 2011-05-17 13:43:45 +01:00
Jürg Lehni
160f3d55c7 Make View#transform() private. 2011-05-17 13:43:10 +01:00
Jürg Lehni
f3f5515763 Add comment about potential renaming of artworkToView -> projectToView? 2011-05-17 13:42:45 +01:00
Jürg Lehni
ac364014da Actually use matrix when drawing view. 2011-05-17 13:42:20 +01:00
Jürg Lehni
2f63127b02 Simplify and fix View#setZoom(). 2011-05-17 13:41:42 +01:00
Jürg Lehni
26269d394a Rename project/ProjectView -> ui/View. 2011-05-17 13:29:07 +01:00
Jürg Lehni
7b4dd222ac Completely decouple ProjectView from Project. 2011-05-17 13:25:46 +01:00
Jürg Lehni
e5f8ee0464 Write comment about calling base() from Layer#initialize(). 2011-05-17 13:14:23 +01:00
Jürg Lehni
c07f9b438e Use same modification in static create() method of ParagraphStyle and CharacterStyle as was used in PathStyle. 2011-05-17 13:14:04 +01:00
Jürg Lehni
2c03cb1ccb Use Base.initialize() in both ParagraphStyle and CharacterStyle's #initialize(). 2011-05-17 13:13:24 +01:00
Jürg Lehni
6427bca46e No beans required in ParagraphStyle yet. 2011-05-17 13:12:44 +01:00
Jürg Lehni
7d1d6fa9da Define Base.initialize() as a general purpose way to initialize a newly created object with values from a provided object and default values from another, in case they are not provided. 2011-05-17 13:12:19 +01:00
Jürg Lehni
5369b251ae Move comment. 2011-05-17 13:11:09 +01:00
Jürg Lehni
41dd9eb131 Point.read() always returns an object even if nothing is provided, no need to have a default value. 2011-05-17 13:10:57 +01:00
Jürg Lehni
e5198fea40 Remove unused code that seems to stem from PointText. 2011-05-17 13:10:22 +01:00
Jürg Lehni
515dbbb151 Fix error in Item#removeChildren(). 2011-05-17 13:09:10 +01:00
Jürg Lehni
eafc0d202e Add comment about #clockwise magic happening in #append*() methods. 2011-05-16 20:17:14 +01:00
Jürg Lehni
889b1687f9 Use #setChildren() in Group constructor and allow passing of children both as arguments and inside an array. 2011-05-16 20:16:27 +01:00
Jürg Lehni
baf35ea18c Rename parameter. 2011-05-16 20:15:16 +01:00
Jürg Lehni
8a449b0e76 Remove deprecated Item#appendChild(). 2011-05-16 20:14:49 +01:00
Jürg Lehni
f12ed7234a Shorten code. 2011-05-16 19:44:46 +01:00
Jürg Lehni
97c4435d87 Fix typo. 2011-05-16 19:35:42 +01:00
Jürg Lehni
d535a1f6fc Clean up method sequence in Item. 2011-05-16 19:35:09 +01:00
Jürg Lehni
75b0fa3596 Add Item#removeChildren() and #setChildren(). 2011-05-16 19:34:57 +01:00
Jürg Lehni
c4203fe174 Change the way associated PathStyles are created and updated. 2011-05-16 19:21:36 +01:00
Jürg Lehni
05c0eb0e51 Simplify PathStyle#initialize(). 2011-05-16 19:20:32 +01:00
Jürg Lehni
34110fa82d Move #_setStyle() closer to the related styles hash. 2011-05-16 19:19:18 +01:00
Jürg Lehni
c8c47bf641 get styles directly from _style object rather than passing through getters on Item. 2011-05-16 18:57:47 +01:00
Jürg Lehni
da670b4171 Improve comments. 2011-05-16 18:29:53 +01:00
Jürg Lehni
8b2da34483 Remove reference to inexisting Request.js file. 2011-05-16 16:57:52 +01:00
Jonathan Puckey
4ebb6985d6 CharacterStyle: Use 'sans-serif' as default font. 2011-05-16 15:58:10 +02:00
Jonathan Puckey
6dbecffd85 Merge remote branch 'origin/master' 2011-05-16 15:46:35 +02:00
Jonathan Puckey
2be70ae73f Gradient#setStops: improve checking for array. 2011-05-16 15:46:25 +02:00
Jürg Lehni
b65ec49207 Merge remote-tracking branch 'origin/master' 2011-05-16 14:26:48 +01:00
Jürg Lehni
c30565fb7b Remove files forgotten in recent renaming. 2011-05-16 14:26:16 +01:00
Jonathan Puckey
979ab18e9a Implement basic version of TextItem, PointText, CharacterStyle & ParagraphStyle. 2011-05-16 15:15:47 +02:00
Jonathan Puckey
4ad47ed3aa Fix accidental internal bean access to #fillColor and #strokeColor in Path#_transform. 2011-05-16 15:11:13 +02:00
Jürg Lehni
cfe968d30e Rename Document -> Project, DocumentView -> ProjectView, paper.document -> paper.project and paper.documents -> paper.projects, to avoid name clashing with window.document. 2011-05-16 13:33:15 +01:00
Jürg Lehni
edd36e7df8 Remove Document#bounds and #size, since this will be on Page. 2011-05-16 13:10:18 +01:00
Jürg Lehni
fa0b664312 Fix error in mousedown handler when using eventInterval. 2011-05-16 13:08:22 +01:00
Jürg Lehni
a19f2020fb Use that instead of this, since we're in an unbound callback. 2011-05-16 13:06:26 +01:00
Jürg Lehni
1747118ed4 Have onResize() call onFrame() if it's defined. 2011-05-16 13:03:02 +01:00
Jürg Lehni
0504b99af8 Redraw DocumentView in #setViewBounds(). 2011-05-16 12:45:49 +01:00
Jürg Lehni
671d790068 Fix bug caused by recent commit. 2011-05-16 12:43:51 +01:00
Jürg Lehni
6051fe3fda Add / fix DocumentView#viewBounds, #center, #bounds, #size. 2011-05-16 12:37:02 +01:00
Jürg Lehni
6e4334ee29 Fix Size#toString(). 2011-05-16 12:36:17 +01:00
Jürg Lehni
f545805786 Move Rectangle#transformCornerCoordinates() to Matrix#_transformCorners(). 2011-05-16 12:29:52 +01:00
Jürg Lehni
fc547793fa Remove redundant Rectangle#transformBounds() and merge its code with less optimised Matrix#transformBounds(). 2011-05-16 12:25:18 +01:00
Jürg Lehni
aaceeb4f54 Add Rectangle#transformBounds(). 2011-05-16 11:32:33 +01:00
Jürg Lehni
fc776f03eb Add Rectangle#transformCornerCoordinates() and use it in Item.drawSelectedBounds(). 2011-05-16 11:25:39 +01:00
Jürg Lehni
9f34042bae Fix comment. 2011-05-16 11:19:47 +01:00
Jürg Lehni
42e7fc910f Simplify GradientColor#transform(), using new _transformPoint() parameters. 2011-05-16 11:19:40 +01:00
Jürg Lehni
f0b29e0e4d Make Item#position a LinkedPoint and change the way it's transformed in #transform(). 2011-05-16 11:19:19 +01:00
Jürg Lehni
f92434ab54 Add dontNotify parameter to _transformPoint(), required sometimes for LinkedPoints. 2011-05-16 11:18:53 +01:00
Jürg Lehni
9384fb4fb5 Add an optinonal dest parameter to Matrix#_transformPoint(). 2011-05-16 11:07:39 +01:00
Jürg Lehni
71bf4fdbca Two forms of scoping are required when evaluating PaperScripts: with(){} and a function scope, so local vars are not trying to override properties on the scope through with(){} (e.g. var view = ...). 2011-05-16 11:00:33 +01:00
Jürg Lehni
2773ef693a Add PaperScope#view and #layer as shortcuts to #document.activeView / activeLayer. 2011-05-16 10:59:45 +01:00
Jürg Lehni
a601cfdd6d Clear the indices and path references of the removed segments. 2011-05-16 01:37:31 +01:00
Jürg Lehni
98a59a3011 Rename PaperScript#run() to #evaluate() and add it to PaperScope too. 2011-05-16 01:22:06 +01:00
Jürg Lehni
c403dccea3 Expose capability to run PaperScripts from script tags. 2011-05-16 00:57:13 +01:00
Jürg Lehni
30e3359d1d Split PaperScope#remove() into #clear() and #remove(), so scopes can be reused. 2011-05-16 00:56:47 +01:00
Jürg Lehni
593813660a Associate PaperScope objects with the script tag that produced them through an assigned unique id. 2011-05-16 00:29:29 +01:00
Jürg Lehni
78a9f9afe9 Let Keyboard handlers know which view should receive keyboard focus. 2011-05-16 00:17:37 +01:00
Jürg Lehni
3e71278b78 Make sure the frame handler stops when a view is removed. 2011-05-16 00:05:11 +01:00
Jürg Lehni
abcba7deb4 Remove all views in Document#remove(). 2011-05-16 00:05:03 +01:00
Jürg Lehni
3a15360efc Rename ChangeFlags.PATH to GEOMETRY. 2011-05-16 00:01:06 +01:00
Jürg Lehni
690a79722f Add alternative code for setting handler on tool that does not rely on eval(), commented out for now. 2011-05-15 23:56:41 +01:00
Jürg Lehni
5bc2889f1c Add documentation and remove dontSwitch parameter, since it will also receive the time as defined for requestAnimationFrame() callback. 2011-05-15 23:50:53 +01:00
Jürg Lehni
535e5fc5fc Add support for onResize handler. 2011-05-15 23:46:34 +01:00
Jürg Lehni
3bd4db802c Simplify onFrame handling. 2011-05-15 23:41:24 +01:00
Jürg Lehni
c1dc823706 Move onFrame handler to DocumentView. 2011-05-15 23:37:40 +01:00
Jürg Lehni
f69b0a404a Remove unused #document from Tool. 2011-05-15 22:45:15 +01:00
Jürg Lehni
824870196e Clean up mouseup handler. 2011-05-15 22:43:30 +01:00
Jürg Lehni
83373576f2 Fix various refactoring errors. 2011-05-15 22:41:56 +01:00
Jürg Lehni
e8033730c8 Move event handling from Tool to DocumentView. 2011-05-15 22:25:46 +01:00
Jürg Lehni
f0e8c54008 Step one of transition to proper separation of view and document, regarding canvas drawing, mouse interaction, resizing, frame handling, etc. Work in progress. 2011-05-15 21:56:43 +01:00
Jürg Lehni
0dc2241a9c No need to set _index to null since Base.splice() handles that for us. 2011-05-15 21:42:31 +01:00
Jürg Lehni
9c97e44207 Have Base.splice() delete the indices of removed items. 2011-05-15 21:37:01 +01:00
Jürg Lehni
31be916c4f Add dontModify parameter to #set() method in Linked* classes, and rename #_set to #_setter. 2011-05-15 20:34:22 +01:00
Jürg Lehni
a2dc2c7dd8 Fix comment. 2011-05-15 20:27:12 +01:00
Jürg Lehni
818c847d73 Add LinkedSize and use it in Rectangle#getSize(). 2011-05-15 20:26:56 +01:00
Jürg Lehni
10d56f318f Add Size#isZero(). 2011-05-15 20:26:37 +01:00
Jürg Lehni
638d768406 Move Point#equals() to other test methods. 2011-05-15 20:26:20 +01:00
Jürg Lehni
217a2e6ecb Remove dirty rectangle test code for now. 2011-05-15 20:09:50 +01:00
Jürg Lehni
ef0347a6bc Fix accidental internal bean access to #segments. 2011-05-15 19:58:29 +01:00
Jürg Lehni
ebdf5a2dfd Shorten CompoundPath#moveBy(). 2011-05-15 19:58:09 +01:00
Jürg Lehni
54161f81f1 Add expected parameters to function signature. 2011-05-15 19:57:48 +01:00
Jürg Lehni
c4c4f51eb9 Shorten getCurrentPath(). 2011-05-15 19:31:25 +01:00
Jürg Lehni
7ba2fcad2a Allow passing of Paths to CompoundPath constructor as arguments, without an array object. 2011-05-15 19:14:09 +01:00
Jürg Lehni
0fd8c4e046 Fix CompoundPath test and add it to load.js so it actually gets tested. 2011-05-15 19:09:34 +01:00
Jürg Lehni
c9d0f982c2 Don't set _clockwise in Path#isClockwise(), as it should only be set once the use explicitely does so. 2011-05-15 19:02:50 +01:00
Jürg Lehni
d12608c708 Minor clean ups. 2011-05-15 18:53:09 +01:00
Jonathan Puckey
a9fbc41e15 Clean up Item#name code. 2011-05-15 19:27:32 +02:00
Jürg Lehni
1b58719202 Merge remote-tracking branch 'origin/master' 2011-05-15 18:13:00 +01:00
Jonathan Puckey
a90aa09bd7 Merge remote branch 'origin/master' 2011-05-15 19:12:38 +02:00
Jonathan Puckey
d998cd30f3 Add support for accessing items by name through their parent's children list. 2011-05-15 19:12:27 +02:00
Jürg Lehni
36c9286ca9 Add #count to onFrame() event. 2011-05-15 18:08:41 +01:00
Jürg Lehni
4cee442a05 Rename items parameter to paths. 2011-05-15 18:05:47 +01:00
Jürg Lehni
3d76034600 Use Path#setClockwise() in CompoundPath constructor to reverse top path so that the others appear as holes cut out from it. 2011-05-15 18:05:00 +01:00
Jürg Lehni
813b70c70b Update comment a bit to make code more clear. 2011-05-15 17:59:57 +01:00
Jürg Lehni
6e0e31480a Remove recently introduced code blocks for small conditional statements. 2011-05-15 17:59:37 +01:00
Jürg Lehni
40c988b313 Add Path#is/setClockwise(), as a way to check and define a path's orientation. 2011-05-15 17:59:06 +01:00
Jürg Lehni
6fc418b581 Fix accidentally reversed change and clean up code a bit. 2011-05-15 15:12:59 +01:00
Jürg Lehni
252a3635dc Replace {@true} tags in documentation ({@true ([^}]*)} -> true $1, false otherwise.) 2011-05-15 15:06:10 +01:00
Jürg Lehni
ee8b66e19a Remove methods / fields that are hidden on Scriptographer through @jshide. 2011-05-15 15:03:33 +01:00
Jürg Lehni
2c078d8b17 Remove all code blocks and group titles from documentation since we're relying on Scriptographer code and documentation generation (through javadoc) for docs. 2011-05-15 15:01:59 +01:00
Jürg Lehni
c91cbe2175 Merge remote-tracking branch 'origin/master' 2011-05-15 14:37:34 +01:00
Jürg Lehni
057b71ff4c Don't overuse variable chaining - use only were readibility does not suffer. 2011-05-15 14:29:00 +01:00
Jonathan Puckey
f8f6754068 Fix mistake in earlier commit. 2011-05-15 14:26:08 +02:00
Jonathan Puckey
3f8f539aeb Fix bugs in Raster#getAverageColor. 2011-05-15 14:13:47 +02:00
Jonathan Puckey
2c36f3a62e Fix bug in Color#read. 2011-05-15 14:11:35 +02:00
Jonathan Puckey
1a82ef4a34 Merge remote branch 'origin/master' 2011-05-15 14:09:57 +02:00
Jürg Lehni
51dbd85db5 Add experimental orientation detection for Paths. 2011-05-15 11:33:09 +01:00
Jürg Lehni
06f16d0c2a Define a unique id for each PaperScript. 2011-05-15 11:32:42 +01:00
Jürg Lehni
3cb78db5f5 Fix typo. 2011-05-15 11:32:09 +01:00
Jürg Lehni
1dd0ee2533 Simplify Item#getId() 2011-05-14 22:38:27 +01:00
Jürg Lehni
0d85e0941c Add inverse matrix caching. 2011-05-14 20:20:10 +01:00
Jürg Lehni
064f3e05d3 Simplify paper scope switching code for now, as key handling code depends on paper object to always point to a valid one. This is a workaround, rethinking of how key handling should be distributed across multiple instances within one page is required. 2011-05-14 20:08:14 +01:00
Jonathan Puckey
fa41328804 Merge remote branch 'origin/master' 2011-05-14 20:37:25 +02:00
Jonathan Puckey
42ae3ce42e CompoundPath#draw: set param.compound to false when done drawing. 2011-05-14 20:36:58 +02:00
Jürg Lehni
df1c5cdcbb Add Document#remove(). 2011-05-14 18:58:41 +01:00
Jürg Lehni
5593eb94d0 Simplify Item#_removeFromParent(). 2011-05-14 18:11:31 +01:00
Jürg Lehni
4e059af684 Reassign Item#_index in #reverseChildren(). 2011-05-14 18:07:45 +01:00
Jürg Lehni
0bab694a01 Rename Item#children to private Item#_children and add #getChildren getter. 2011-05-14 18:07:10 +01:00
Jürg Lehni
185a7f15ac Fix newly introduced error. 2011-05-14 18:00:29 +01:00
Jürg Lehni
897e00fee5 Have Document#activate() use the internal #_index property. 2011-05-14 17:57:59 +01:00
Jürg Lehni
2fa64bb343 Add Document#getIndex(). 2011-05-14 17:57:43 +01:00
Jürg Lehni
df51b25fec Add comment about plain properties that need to send _changed() notifications. 2011-05-14 17:57:23 +01:00
Jürg Lehni
de34f8c157 Clear Item#_index when removing item and simplify #getIndex(). 2011-05-14 17:56:56 +01:00
Jürg Lehni
25c2d68f37 Switch to Item#_parent / #getParent() as property is read-only. 2011-05-14 17:56:14 +01:00
Jürg Lehni
37e4c654d3 Use Date.now() as all supported browsers have it. 2011-05-14 17:23:17 +01:00
Jürg Lehni
f6f307822a Fix comment. 2011-05-14 17:23:00 +01:00
Jürg Lehni
01fdeb270b Move PaperScript.js to core. 2011-05-14 17:22:49 +01:00
Jürg Lehni
53293ab8bd Merge remote-tracking branch 'origin/master' 2011-05-14 16:00:47 +01:00
Jürg Lehni
0356fdb3b6 Add PaperScope switching to onFrame handler. 2011-05-14 16:00:30 +01:00
Jürg Lehni
8375a97d55 Scope setting / restoring can be simplified since it should never be nested. 2011-05-14 15:59:19 +01:00
Jonathan Puckey
2de41253c2 Fix bug where document wasn't being redrawn after onMouseDrag events. 2011-05-14 16:58:37 +02:00
Jürg Lehni
c89fcdcb2e Merge remote-tracking branch 'origin/master'
Conflicts:
	src/tool/Tool.js
2011-05-14 15:27:56 +01:00
Jürg Lehni
518803f492 Add support for switching PaperScope contexts in PaperScript code exeuction and callback handling. This should add proper support for multiple PaperScript instances in one site. 2011-05-14 14:15:31 +03:00
Jürg Lehni
3072eed91d Clean up ToolHandler code by making many fields private, to better reflect the Java version. 2011-05-14 14:13:48 +03:00
Jonathan Puckey
2bfe42da05 Have the CompoundPath constructor reverse the segments of all paths passed to it except for the first one. Introduce 'keepDirection' option to allow importing of already existing CompoundPath items. 2011-05-14 13:03:18 +02:00
Jonathan Puckey
35d51085a1 Tool: fix problem where document was being redrawn onMouseMove with only an onMouseDrag handler (should only happen on touch devices) 2011-05-14 12:59:21 +02:00
Jürg Lehni
edaaaa4df5 Merge PaperScope injection and creation into one statement. 2011-05-14 13:39:43 +03:00
Jürg Lehni
a1efd85ecb Improve PaperScope definition so it also works when using load.js, and seperate paper.js code into core/Base.js and core/PaperScope.js. 2011-05-14 13:38:45 +03:00
Jürg Lehni
9ef31616d5 Have paper.install() use Base.each(). 2011-05-14 13:14:43 +03:00
Jürg Lehni
d64fe1f179 Improve comments. 2011-05-14 13:12:49 +03:00
Jürg Lehni
91332d465a Switch to using an internal PaperScope class and have the global paper variable simply be a pointer to the currently active one (step one of PaperScope context switching and support of multiple PaperScript instances within one web-site). 2011-05-14 13:10:38 +03:00
Jürg Lehni
3feb45addc Add keepalive attribute to canvas to tag that controls wether it animates in background in emulated requestAnimationFrame() function, and use it in all example files. 2011-05-14 13:04:02 +03:00
Jürg Lehni
a775e66632 Do not use #splice() for the initial push to the documents / children list. 2011-05-14 12:42:52 +03:00
Jürg Lehni
8c2ad5f331 Improve documentating comments. 2011-05-14 12:41:06 +03:00
Jonathan Puckey
032d19b0d2 Fix bug in CompoundPath where toCssString was being called instead of getCanvasStyle, resulting in problems when gradients were used. 2011-05-12 15:30:56 +02:00
Jonathan Puckey
d3e9a1152d Merge remote branch 'origin/master' 2011-05-11 22:46:53 +02:00
Jonathan Puckey
bd932a9242 Implement onFrame event.delta & event.time. 2011-05-11 22:46:08 +02:00
Jürg Lehni
366122cd33 Merge remote-tracking branch 'origin/master' 2011-05-08 21:46:54 +01:00
Jürg Lehni
079008b243 Code clean up. 2011-05-08 21:46:49 +01:00
Jürg Lehni
b44d85277f Fix resizing of invisible canvas elements, by remembering their last offset when they were visible. 2011-05-08 21:46:41 +01:00
Jonathan Puckey
ccf5dd70f6 PaperScript: call the onFrame handler straight away. 2011-05-08 18:44:33 +01:00
Jonathan Puckey
5ddb8e22d3 Merge remote branch 'origin/master' 2011-05-08 17:33:42 +01:00
Jürg Lehni
c44b9b254e Fix error in ToolEvent#delta. 2011-05-08 17:32:59 +01:00
Jonathan Puckey
34077dc901 Item#_getBounds: don't include bounds of hidden items. 2011-05-08 17:17:54 +01:00
Jonathan Puckey
4490403ae9 Undo last commit. 2011-05-08 16:53:59 +01:00
Jonathan Puckey
6cd8241df8 Set default currentStyle of Document to have a black stroke color. 2011-05-08 16:48:41 +01:00
Jürg Lehni
de2bbe844b Use getters rather than beans. 2011-05-08 15:51:01 +01:00
Jürg Lehni
e79d890432 Add #toString() to Event#modifiers. 2011-05-08 15:50:17 +01:00
Jürg Lehni
585e3b6254 Clean up and shorten code. 2011-05-08 15:45:40 +01:00
Jürg Lehni
af8fd22ae2 Remove hyphen from event types, to go with the naming of the browser world more. 2011-05-08 15:35:10 +01:00
Jürg Lehni
04ff593adc Have Events print modifiers correctly in #toString(). 2011-05-08 15:33:00 +01:00
Jürg Lehni
5a9dc3dece Have Event#modifiers exposed as a bean. 2011-05-08 15:28:56 +01:00
Jürg Lehni
6593c07127 Fix more key handling bugs and make Key.isDown() work again. 2011-05-08 15:28:35 +01:00
Jürg Lehni
450fadfcbf Fix issues with keys that fire both keydown and keypress events, such as space. 2011-05-08 15:23:32 +01:00
Jürg Lehni
3afe7ea5bb Merge remote-tracking branch 'origin/master' 2011-05-08 15:16:52 +01:00
Jürg Lehni
742c9da822 More work on key handling and rename KeyEvent#keyCode -> KeyEvent#key. 2011-05-08 15:16:41 +01:00
Jürg Lehni
9f47942e7a Fix typo. 2011-05-08 15:16:18 +01:00
Jonathan Puckey
94889148a4 GradientColor: clone origin / destination & hilite points. 2011-05-08 14:29:58 +01:00
Jürg Lehni
e0e8ee0152 Remove _owner check in Base.read() again. 2011-05-08 14:29:49 +01:00
Jürg Lehni
aac87dba14 Move #toString() to the end. 2011-05-08 14:13:33 +01:00
Jürg Lehni
7034f8241b Remove deprecated onOptions. 2011-05-08 14:09:55 +01:00
Jonathan Puckey
436cbe49a8 Merge remote branch 'origin/master' 2011-05-08 14:06:16 +01:00
Jonathan Puckey
bbccb25184 Transform gradient when path is transformed. 2011-05-08 14:05:47 +01:00
Jürg Lehni
37f982e53f Remove unused lookup table. 2011-05-08 13:46:31 +01:00
Jürg Lehni
b26caee702 Improve key event handling, work in progress. 2011-05-08 13:43:52 +01:00
Jürg Lehni
2f4f003873 Have Base.read() clone owned objects such as SegmentPoint or LinkedPoint. 2011-05-08 13:38:09 +01:00
Jürg Lehni
926fffee4a Rename Event -> DomEvent and Element -> DomElement, to be more specific and not clash with other classes, e.g. a future base class for ToolEvent and KeyEvent. 2011-05-08 10:16:11 +01:00
Jürg Lehni
0e37f86156 Fix porting mistakes. 2011-05-08 10:07:10 +01:00
Jürg Lehni
327515a9de Add missing header. 2011-05-08 09:59:37 +01:00
Jürg Lehni
bb5146397c Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-08 00:54:15 +01:00
Jürg Lehni
4be33a2b3f Update Element bounds, scroll and visibility handling to take nested divs with overflow into account . 2011-05-08 00:54:07 +01:00
Jonathan Puckey
3118d8547d Include HSBColor.js in paper.js. 2011-05-08 00:23:59 +01:00
Jürg Lehni
c053fb977a Export PaperScript object and its load function as paper.load. 2011-05-07 20:50:32 +01:00
Jürg Lehni
081a303de0 Make sure PaperScripts are not loaded more than once by setting the loaded attribute to true on them. 2011-05-07 20:50:12 +01:00
Jonathan Puckey
791d9335ce Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-07 18:18:51 +01:00
Jonathan Puckey
4649835d5b Document: fix selection drawing in Firefox. 2011-05-07 18:18:14 +01:00
Jürg Lehni
20409f3084 Use Base.splice() for Layers too. 2011-05-07 17:27:19 +01:00
Jürg Lehni
566f52201c Fix typo. 2011-05-07 17:11:12 +01:00
Jürg Lehni
70d0dd9c0c Move #moveTo() to the same scope as the other drawing commands, and add explaining comments. 2011-05-07 17:11:06 +01:00
Jürg Lehni
979bda52ab We don't need the empty #initialize(). 2011-05-07 17:05:42 +01:00
Jürg Lehni
d254d9542d Add ChangeFlags.HIERARCHY, for future change notifications when children get rearranged. 2011-05-07 16:52:54 +01:00
Jürg Lehni
6c3fd5953a Simplify Symbol#setDefinition(). 2011-05-07 16:14:12 +01:00
Jürg Lehni
8c7b253bc2 Add Base.splice() to handle lists of items with _index referneces and use it for paper.documents and Item#children. 2011-05-07 16:11:05 +01:00
Jürg Lehni
b44e796475 Make sure getters dont return undefined but null instead. 2011-05-07 16:10:38 +01:00
Jürg Lehni
79f55aa908 Fix recently introduce error in append(). 2011-05-07 15:41:07 +01:00
Jürg Lehni
999fb129cc Some code clean ups. 2011-05-07 15:40:02 +01:00
Jürg Lehni
81c1b2dcce Clean up Path#_add() a bit. 2011-05-07 15:38:36 +01:00
Jürg Lehni
450d277fb4 Avoid necessity of try-catch around code evaluation by declaring all local variables that we are looking for. 2011-05-07 15:38:14 +01:00
Jürg Lehni
afe61d61ac Fix recently introduced errors in setting of Tool#_document. 2011-05-07 15:37:12 +01:00
Jürg Lehni
9ef542ff9a Add comment to #_canged(). 2011-05-07 14:57:20 +01:00
Jürg Lehni
3ff2880ca8 Make Item#setDocument() and #removeFromParent() private. 2011-05-07 14:50:48 +01:00
Jürg Lehni
ef8a2aad9b Remove Tool#setDocument(). 2011-05-07 14:50:31 +01:00
Jürg Lehni
2f6fbcba74 Check result from removeFromParent(). 2011-05-07 14:34:57 +01:00
Jürg Lehni
59e2783979 Use tripple equal operators for string compares now. 2011-05-07 14:32:27 +01:00