Commit graph

374 commits

Author SHA1 Message Date
Jonathan Puckey
7a4c44ec7b Matrix documentation. 2011-05-31 16:08:25 +02:00
Jonathan Puckey
31bf3ffa70 Matrix: add param tags to #applyToContext documentation. 2011-05-31 14:25:24 +02:00
Jonathan Puckey
8b7d7b68e1 Size: fix typo in documentation. 2011-05-31 14:24:30 +02:00
Jonathan Puckey
7eb35bf6fb Point documentation: add examples to Point.min, Point.max and Point.random. 2011-05-31 01:19:33 +02:00
Jonathan Puckey
6892608ecd Documentation: rename 'Sample Code:' to 'Example:' 2011-05-30 19:55:40 +02:00
Jonathan Puckey
17fcb923ff Documentation: rearrange @example tags, improve examples, rename boolean -> Boolean and misc smaller edits. 2011-05-30 19:42:17 +02:00
Jonathan Puckey
f9eca3efbf Docs: improve the description of the Size class. 2011-05-29 17:40:23 +02:00
Jonathan Puckey
9012bed504 Matrix: add some docs todos and make center optional in Matrix#shear. 2011-05-29 17:34:51 +02:00
Jonathan Puckey
005f505959 Matrix: add documentation for Matrix#scale(scale[, center]). 2011-05-29 17:31:13 +02:00
Jonathan Puckey
556c927448 Improve docs of Point#equals and Rectangle#equals. 2011-05-29 14:20:48 +02:00
Jonathan Puckey
4fcd26a914 Docs: remove todo. 2011-05-29 14:05:32 +02:00
Jonathan Puckey
ea192e3817 Document Point#normalize and Point#quadrant. 2011-05-29 13:54:53 +02:00
Jonathan Puckey
9cc3b03f83 Document different constructors of Point, Rectangle & Size. 2011-05-28 02:38:33 +02:00
Jonathan Puckey
cd76c8c0e1 Documentation: remove ^n from method names, since this isn't necessary anymore. 2011-05-28 02:18:10 +02:00
Jonathan Puckey
1520cad144 Documentation: capitalize basic types in @ tags. 2011-05-27 21:21:49 +02:00
Jonathan Puckey
8e84c79aa6 Documentation: capitalize 'string' and 'number' types. 2011-05-27 20:15:15 +02:00
Jonathan Puckey
cf73f55c78 Documentation: use @link in Rectangle#include explanation. 2011-05-27 20:05:31 +02:00
Jonathan Puckey
4015b022ad Docs: use @true tag in boolean return descriptions and add Key.isDown param options. 2011-05-27 18:43:27 +02:00
Jonathan Puckey
10763edc68 Add Line documentation. 2011-05-27 13:53:59 +02:00
Jonathan Puckey
ca3230c1ad Documentation: reorder functions, add group titles and todos. 2011-05-27 13:28:13 +02:00
Jonathan Puckey
6b611add37 More documentation edits and function reordering. 2011-05-26 20:09:25 +02:00
Jonathan Puckey
0388917d90 Add @return to Point#directedAngle. 2011-05-26 16:49:51 +02:00
Jonathan Puckey
00eea86d25 Some documentation edits in Point. 2011-05-26 00:54:59 +02:00
Jonathan Puckey
e66e8e330b Point: whitespace. 2011-05-23 18:04:08 +02:00
Jonathan Puckey
a988f1b7a2 Matrix documentation: whitespace. 2011-05-23 13:37:26 +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
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
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
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
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
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
Jonathan Puckey
e8cf29fd6c Size#min and Size#max: fix capitalization. 2011-05-18 21:31:02 +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
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
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
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
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
Jonathan Puckey
74dd89a68b Use Point#read in Point#min and Point#max. 2011-05-06 15:37:55 +01:00
Jürg Lehni
c36db3a55c Introduce private faster Matrix#_transform* methods that lack arguments checks, and use them internally. 2011-05-06 13:28:35 +01:00
Jürg Lehni
bc80c58558 Add Base.formatNumber() to format numbers in the same way as Scriptographer (precision of up to 5 fractional digits) and use it in the various #toString() functions. 2011-05-04 19:42:50 +01:00
Jürg Lehni
47c88a1252 Compress math functions in Size the same way as in Point. 2011-05-02 23:09:59 +01:00
Jonathan Puckey
2ee7081c14 Merge remote branch 'origin/master' 2011-05-02 12:25:32 +02:00
Jonathan Puckey
41120cf4d9 Various small code cleanups. 2011-05-02 12:23:42 +02:00
Jürg Lehni
4bac4b89f6 Clean up other Point.create() calls. 2011-05-01 23:37:15 +01:00
Jürg Lehni
51e5a29a9d Change Point#set() calls back to clearer multi-line notation. 2011-05-01 23:36:08 +01:00
Jürg Lehni
756c4f37c5 Compress Point#getQuadrant() to one line. 2011-05-01 23:34:00 +01:00
Jürg Lehni
77c19601ff Improve Point#normalize(). 2011-05-01 23:32:37 +01:00
Jürg Lehni
4b832e0ea9 Simplify Point#setLength(). 2011-05-01 23:28:57 +01:00
Jürg Lehni
dd442bf960 Correct comment. 2011-04-30 23:06:41 +01:00
Jürg Lehni
13dca647c3 Simplify Point#rotate(). 2011-04-30 23:06:21 +01:00
Jürg Lehni
2b5e9296f7 Simplify Point#getDirectedAngle(). 2011-04-30 23:05:31 +01:00
Jürg Lehni
ab634f2391 Remove unneeded Point#getDistanceSquared(). 2011-04-30 23:04:23 +01:00
Jürg Lehni
5211e86e3a Rename Point#isParallel() to #isColinear(), reimplement it using #cross() and add #isOrthogonal() as well, using #dot(). 2011-04-28 15:12:58 +01:00
Jonathan Puckey
4b4e092f90 Undo previous compressing of Rectangle functions. 2011-04-28 15:44:05 +02:00
Jürg Lehni
037adc074d Merge remote-tracking branch 'origin/master' 2011-04-28 13:23:27 +01:00
Jürg Lehni
4d999d57e2 Replace all type converting string compares with ===, !==. 2011-04-28 13:23:17 +01:00
Jonathan Puckey
dd2b546914 Merge remote branch 'origin/master' 2011-04-28 14:22:44 +02:00
Jonathan Puckey
8f2bc422dd Point: compress round, ceil, floor and abs functions. 2011-04-28 14:22:25 +02:00
Jonathan Puckey
b4ee975cfb Rectangle: minor changes. 2011-04-28 14:15:12 +02:00
Jürg Lehni
115ef45464 Remove unnecessary .0 since numbers are all the same in JavaScript. 2011-04-28 13:13:33 +01:00
Jonathan Puckey
e0b5dbad21 Rectangle: compress unite, intersect and include. 2011-04-28 13:45:55 +02:00
Jürg Lehni
bdfe35d93a Consistently name local context variables 'ctx', to save line size and acknowledge the fact that Canvas contexts have a funny API design. 2011-04-26 15:39:16 +01:00
Jonathan Puckey
bd59e48682 Fix problem with Point constructor when passed { angle: 0, length: n }, by checking for undefined. 2011-04-12 13:48:44 +02:00
Jürg Lehni
b5fdecf3d1 Rename ObservedRectangle to LinkedRectangle, ObservedPoint to LinkedPoint, and add more comments about what it is they are doing. 2011-03-22 17:27:46 +00:00
Jürg Lehni
dbb947b7aa Finish ObservedRectangle, by solving observer notification for all setters. 2011-03-22 17:15:56 +00:00
Jürg Lehni
1267f41559 Add beginning of ObservedRectangle support and test it in animatedStar example. 2011-03-16 23:32:46 +01:00
Jürg Lehni
b1c0a48552 Add ObservedPoint class that records changes and passes them on to the owner, and use it for all Point objects returned from Rectangle. 2011-03-16 07:12:34 +01:00
Jürg Lehni
c8449162d8 Remove unnecessary checks for rect. 2011-03-13 22:48:07 +01:00
Jürg Lehni
9d4af0ce9e Clean up recently caused Base.read() mess by introducing _readNull property,m setting it to true on Color and reverting to previous behavior for Point, Size and Rectangle, where dimensions of 0 are read by default if nothing is provided. 2011-03-13 18:31:00 +01:00
Jürg Lehni
526e2ea0ba Hide Curve#getLength() parameters from Bootstrap so it injects bean too. 2011-03-08 17:31:36 +00:00
Jürg Lehni
3927836441 Declare functions that work both as getters for beans and also as callalble functions with optional parameters differently, since they do not inject beans anymore if they declare parameters. 2011-03-08 17:19:02 +00:00
Jürg Lehni
dd9340d522 Handle all the calls to Base.read() differently, by checking result for null and bailing out if it is. 2011-03-08 17:17:36 +00:00
Jürg Lehni
6a67052090 Update copyright / licensing comments. 2011-03-08 01:41:50 +00:00
Jonathan Puckey
781fd4adda Fix Size#dot. 2011-03-07 18:49:43 +01:00
Jonathan Puckey
6b5ce7c18c Merge remote branch 'origin/master' 2011-03-07 18:39:25 +01:00
Jonathan Puckey
dc25512f73 Compress getters and setters of translateX / translateY / scaleX / scaleY / rotateX / rotateY. 2011-03-07 18:38:50 +01:00
Jürg Lehni
350fef00ec Simplify new getter / setter generation code a bit. 2011-03-07 16:49:24 +00:00
Jonathan Puckey
69829e03f6 Rectangle: optimize creation of corner getters / setters and combine multiple variable declarations. 2011-03-07 13:42:50 +01:00
Jonathan Puckey
1b7dbd659d Compress Rectangle corner getters and setters. 2011-03-07 12:58:00 +01:00
Jürg Lehni
e1a7aff2f0 Add copyright notice and license file. 2011-03-07 00:50:44 +00:00
Jürg Lehni
8ddf5a3d90 Add Matrix#createShiftless(), to return a copy of the matrix that lacks the translation. 2011-03-06 21:10:47 +00:00
Jürg Lehni
670512d123 Finally figured out why Matrix#applyToContext was not working right: The parameters where not passed in the right sequence! 2011-03-06 21:09:52 +00:00
Jürg Lehni
994b9deb8f Fix Matrix#toString() to print values in correct sequence. 2011-03-06 21:08:37 +00:00
Jürg Lehni
607fe8f5d6 Improve argument handling in Matrix constructor. 2011-03-06 21:07:44 +00:00
Jürg Lehni
a7d08bcc08 Use variable definition chaining in Matrix where possible. 2011-03-06 21:06:46 +00:00
Jürg Lehni
32d0f31c31 Introduce Matrix.create() and use where applicable. 2011-03-06 21:05:24 +00:00
Jürg Lehni
47d55e19f5 Impove various angle related code in Point. 2011-03-06 21:03:43 +00:00
Jürg Lehni
420e0435ed Shorten create() methods, except for Point where it might have a performance impact. 2011-03-06 21:02:57 +00:00
Jürg Lehni
deb78b78cf Define fast Rectangle.create() and use it internally where applicable. 2011-03-06 18:45:56 +00:00
Jürg Lehni
15b16aaed9 Add Line class to basics. 2011-03-06 14:45:07 +00:00
Jürg Lehni
2c034475b0 Fix a bug in Point#cross(). 2011-03-06 14:26:23 +00:00
Jürg Lehni
cb2e4aaa04 Imrove Point, Size and Rectangle constructors. 2011-03-06 12:15:15 +00:00
Jürg Lehni
2d2fb400d9 Add comment about Point#isParallel not being very precise. 2011-03-06 10:58:26 +00:00
Jürg Lehni
af909238eb Shorten code a bit. 2011-03-05 21:08:32 +00:00
Jürg Lehni
4dbba5f806 Make sure rectangle dimensions are not undefined when creatig from a Point or Size. 2011-03-05 21:06:23 +00:00
Jürg Lehni
5392268b83 Remove Raster/PlacedSymbol specific code form Matrix#transformBounds() and use Rectangle#setCenter() instead to center the bounds rectangle on the origin. 2011-03-05 21:05:07 +00:00
Jürg Lehni
06ca80573a Allow chaining of all Matrix calls without returns. 2011-03-05 21:04:01 +00:00
Jürg Lehni
7fa53a2db3 Allow chaining of Size setters. 2011-03-05 20:59:06 +00:00
Jürg Lehni
9f67f32701 Allow chaining of Point setters. 2011-03-05 20:58:46 +00:00
Jürg Lehni
a4c67a1bc1 Allow changing of Rectangle setters. 2011-03-05 20:57:45 +00:00
Jürg Lehni
352b3f0d40 More work on Bootstrap core, move Base.isArray back to Array.isArray. 2011-03-05 13:53:18 +00:00
Jürg Lehni
836ee492ae More beans related refactoring. 2011-03-05 02:40:38 +00:00
Jürg Lehni
b06bf88aed More beans clean-up in Rectangle. 2011-03-05 01:59:15 +00:00
Jürg Lehni
c313e702c9 Clean up a whole lot of beans access, and in the process of the refactoring improve canvas, context, size and bounds handling in Raster and PlacedSymbol. 2011-03-05 01:26:12 +00:00
Jürg Lehni
4db061a048 Make sure Point is not using any beans internally. 2011-03-05 00:03:11 +00:00
Jürg Lehni
7355c2d4a7 Switch to using Base.isArray. 2011-03-04 21:47:00 +00:00
Jonathan Puckey
d54c30b9be Avoid using beans in Rectangle.js 2011-03-04 16:18:42 +01:00
Jürg Lehni
92bf51a7cc Simplify the way the paper namespace is created and populated. 2011-03-04 13:34:31 +00:00
Jürg Lehni
c6d79f964c Generalise all read() functions in Base.read(), fix an issue in by making sure arguments passed to initialie are never larger than length, and have Color's initialize create an RGBColor, to still be able to use Color.read(). 2011-03-04 13:19:07 +00:00
Jürg Lehni
2b6dede883 Clean up white-spaces and line lengths. 2011-03-03 22:45:17 +00:00
Jürg Lehni
46a0589547 Use Error constructor correctly. 2011-03-03 17:29:40 +00:00
Jürg Lehni
9a9cb91f72 Use the faster Point/Size.create() constructors across the basic classes for higher performance. 2011-03-03 17:07:12 +00:00
Jürg Lehni
dca26949ff Add Size.create(), in analogy to Point.create(). 2011-03-03 17:06:35 +00:00
Jürg Lehni
5ed30d7089 Make sure all files end on empty line. 2011-03-03 16:32:55 +00:00
Jürg Lehni
941c3c7346 Declare all classes as local variables, so they can be scoped. 2011-03-03 13:33:41 +00:00
Jürg Lehni
3a46ac3b54 Allow read() methods to receive an optional length parameter. 2011-03-03 13:15:55 +00:00
Jürg Lehni
1f29f6f104 Improve formating. 2011-03-03 12:46:50 +00:00
Jürg Lehni
231343c6a2 Fix context orientation bug correct proberly, by flipping shear values instead of scale values. 2011-03-03 12:34:55 +00:00
Jürg Lehni
f9346a3b7a Simplify code by merging setTransform() / transform() call to one. 2011-03-02 16:06:06 +00:00
Jürg Lehni
8c96d91400 Fix errors introduced by bad merge. 2011-03-02 08:52:13 +01:00
Jürg Lehni
3f972be500 Merge remote-tracking branch 'origin/master'
Conflicts:
	src/basic/Matrix.js
	src/item/Raster.js
2011-02-28 23:27:03 +01:00
Jürg Lehni
763fc95776 Fix odd issue of Rasters rotating the wrong way, which seems to be caused by Canvas not using the same Matrix orientation as Paper.js (scaleX (m00) and scaleY (m11) need to be flipped). 2011-02-28 20:15:40 +01:00
Jürg Lehni
700f4aeb6a Add #set() function to Point, Rectangle and Size (Matrix has it already). 2011-02-28 20:14:10 +01:00
Jonathan Puckey
a7429205ed Allow Matrix#applyToContext to optionally reset the matrix transformation. 2011-02-28 18:27:57 +01:00
Jonathan Puckey
95f9028091 Add Point#clone docs to Point.js. 2011-02-24 14:31:32 +01:00
Jonathan Puckey
ebbf8cf039 Add missing introduction to Point.js 2011-02-24 14:30:06 +01:00
Jonathan Puckey
a3ec524722 Add documentation from Point.java to Point.js, remove TODO about adding back center support to Scriptographer for Point#rotate, since it is already there. 2011-02-24 14:28:44 +01:00
Jonathan Puckey
f88fcd3049 Implement Point#transform(matrix). 2011-02-24 13:48:24 +01:00
Jonathan Puckey
5a786c300b Implement Matrix#applyToContext. 2011-02-21 19:03:57 +01:00
Jürg Lehni
8cdd7fe2b2 Remove unnecessary call of new Point(). 2011-02-21 00:28:36 +01:00
Jürg Lehni
dc410b6894 Merge rotateAround() and rotate(). 2011-02-21 00:28:13 +01:00
Jürg Lehni
2ebe4a18da Add Point#isInside(). 2011-02-21 00:24:17 +01:00
Jürg Lehni
04d2ed29c6 Move private createPoint() to Point.create(). 2011-02-21 00:23:36 +01:00
Jürg Lehni
9aabf30800 Optimise Point code more by using an internal createPoint method that bypasses initialize completely. 2011-02-20 23:41:39 +01:00
Jürg Lehni
ed752ed744 Pass ctor.dont to all constructor calls that are followed with explicit initialize() calls afterwards, to make sure it is only called once. 2011-02-20 01:45:53 +01:00
Jürg Lehni
b0b9594f1e Add support for single-parameter calls to scale() and shear(), both in Matrix and Item (supporting optional center parameter too). 2011-02-15 23:23:40 +00:00
Jürg Lehni
99bde74a10 Improve Matrix constructor to read from arrays too. 2011-02-15 23:15:28 +00:00
Jürg Lehni
9d1458e6ae Rely on new Array.isArray() now for array checks. 2011-02-15 23:15:13 +00:00
Jürg Lehni
f0d4374dc4 Improve translate() calls by directly calling Point objects and thus not relying on Point.read() internally. 2011-02-15 22:53:05 +00:00
Jürg Lehni
27f291ec80 Clean up comments. 2011-02-15 22:51:02 +00:00
Jürg Lehni
14bfb4c78e Make Matrix#toString() behave the same as in Scriptographer. 2011-02-15 22:35:25 +00:00
Jürg Lehni
1d0321bc69 Change Size constructor to reflect logic in Point constructor. 2011-02-14 10:32:42 +00:00
Jürg Lehni
12d82ece56 Define beans in Matrix. 2011-02-14 01:52:53 +00:00
Jürg Lehni
ee8c30b518 Implement Matrix, Item#position, Item#bounds (setter too), Item#transform(), Item#scale(), Item#rotate(), Item#transalte() and Item#shear(). Some of it work in progress. 2011-02-14 01:05:16 +00:00
Jürg Lehni
6ef5183731 Fix Rectangle#center (use + instead of -). 2011-02-13 19:22:48 +00:00
Jürg Lehni
20746ad3a7 Clea up white spaces. 2011-02-13 19:21:56 +00:00
Jürg Lehni
7370326cb2 Add space after beans: true. 2011-02-13 18:52:17 +00:00
Jürg Lehni
eeb7d377e6 Add optional index argument to static read() functions, so points, rectangle, sizes and segments can be read from any index in the arguments array. 2011-02-13 18:15:55 +00:00
Jürg Lehni
08d4826441 Reformating code to follow Scriptotgrapher coding conventions. 2011-02-13 16:26:24 +00:00
Jürg Lehni
4f4261488e Fix issues with _angle caching in Point. 2011-02-13 16:24:39 +00:00
Jürg Lehni
0ac19a8e82 Optimise read() functions to only convert if argument is not of desired type already. 2011-02-13 16:05:19 +00:00
Jonathan Puckey
c0e2101c32 Clean up src directory and move Bootstrap.js into lib. 2011-02-12 17:59:39 +01:00