Jürg Lehni
516557808e
Add Base.readAll(), to repeatetly apply Base.read() on all elements of an array and return the result in a new array.
2011-05-03 08:59:55 +01:00
Jürg Lehni
e0edddd5f6
Clean up code ('){' -> ') {')).
2011-05-03 08:57:09 +01:00
Jürg Lehni
66465541c6
Clean up code (if() -> if ()).
2011-05-03 08:55:01 +01:00
Jürg Lehni
52a73e86ce
Clean up code (for() -> for ()).
2011-05-03 08:54:13 +01:00
Jürg Lehni
3af24e6178
Replace hidden getter call with direct access of internal property.
2011-05-03 08:47:52 +01:00
Jürg Lehni
a0e211c691
Big refactoring of how curves are kept in sync with segments (direct references rather than indices), along with various tests.
2011-05-03 00:25:23 +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
98ab342235
Shorten #_transformCoordinates() a bit.
2011-05-02 08:59:51 +01:00
Jürg Lehni
26b70309a8
Improve various #toString() functions.
2011-05-02 08:57:55 +01:00
Jürg Lehni
0a4150a5c9
Add beginning of value caching (_length, _bounds) and change tracking to invalidate cached values.
2011-05-02 00:17:21 +01: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
2cdb15f2d6
Fix recently renamed functions in commented out code.
2011-05-01 23:29:15 +01:00
Jürg Lehni
4b832e0ea9
Simplify Point#setLength().
2011-05-01 23:28:57 +01:00
Jürg Lehni
b0282b9bd4
Change Segment to be aware of its index in the segment list and have the curves list update automatically on each change to segments.
2011-05-01 13:27:53 +01:00
Jürg Lehni
0680a50fd2
Fix yet another two bugs in CurveLocation.
2011-05-01 13:18:36 +01:00
Jürg Lehni
08e779d560
Fix two bugs in CurveLocation.
2011-05-01 13:16:25 +01:00
Jürg Lehni
6bbfd55240
Clean up Path#setSegments and begin moving of logic to keep Path#curves in sync away from Path#getCurves() to Path#setClosed(). Requires more work, e.g. Path#_add().
2011-04-30 23:44:37 +01:00
Jürg Lehni
6cca355e20
Add Curve.create() as faster internal constructor.
2011-04-30 23:29:10 +01:00
Jürg Lehni
053fb2d955
Move Path#get/setSegments back to top and remove test-code for array object extension.
2011-04-30 23:24:39 +01:00
Jürg Lehni
781b315808
Add getter/setter for Path#closed.
2011-04-30 23:22:29 +01:00
Jürg Lehni
bf3bd13540
Simplify Path#cubicCurveTo().
2011-04-30 23:17:19 +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
cd58351864
Add comment about porting chainable calls back to Sg.
2011-04-30 22:30:54 +01:00
Jonathan Puckey
b1d8922fd1
Merge remote branch 'origin/master'
2011-04-28 20:46:39 +02:00
Jonathan Puckey
c14ea8f7b5
Document: resize canvas element when Document#setSize is called.
2011-04-28 20:42:20 +02:00
Jürg Lehni
6d84dc3351
Segment#isSelected() only checks for selection state of point. We need to check _selectionState instead to mirror behaviour in #_setSelected().
2011-04-28 19:04:00 +01:00
Jürg Lehni
d098c6e8b2
Fix index issue in #removeSegments().
2011-04-28 19:03:05 +01:00
Jürg Lehni
121ec5a93f
Allow #removeSegments() to be called without arguments, in which case all segments are removed.
2011-04-28 19:02:34 +01:00
Jürg Lehni
ea510c2403
Separate Path#remove(), #remove(index) & #remove(from, to) into #removeSegment(index) and #removeSegments(from, to).
2011-04-28 15:42:16 +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
3916db4eb8
Fix location of browser related files in load.js.
2011-04-28 13:25:34 +01: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
Jürg Lehni
0d697403b5
Clean up Path#curveTo() code.
2011-04-28 13:12:21 +01:00
Jürg Lehni
7dce6f3a6c
Merge remote-tracking branch 'origin/master'
2011-04-28 13:11:58 +01:00
Jürg Lehni
f69153844b
Make #setContextStyles() a 'protected' function.
2011-04-28 13:04:12 +01:00
Jonathan Puckey
e0b5dbad21
Rectangle: compress unite, intersect and include.
2011-04-28 13:45:55 +02:00
Jonathan Puckey
ad8dfe91c7
Implement Raster#getStrokeBounds().
2011-04-28 12:56:08 +02:00
Jonathan Puckey
e1f5d4952d
Minor cleanups and fixes in Item.
2011-04-28 12:50:53 +02:00
Jonathan Puckey
861812f3ad
Fix bug in previous commit.
2011-04-28 12:39:55 +02:00
Jonathan Puckey
1666a36210
Have Item#_getBounds return a normal rectangle when called with includeStroke flag, since Item#getStrokeBounds is read only.
2011-04-28 12:38:57 +02:00
Jonathan Puckey
eed054af17
Item: implement getStrokeBounds, move getBounds functionality into _getBounds with an includeStroke flag. Also simplify the _getBounds code.
2011-04-28 12:33:03 +02:00
Jonathan Puckey
32f04f6162
Document: implement selectAll() and deselectAll().
2011-04-28 11:54:26 +02:00
Jürg Lehni
d71450c0b1
Make sure selected argument is always a boolean.
2011-04-28 10:05:43 +01:00
Jürg Lehni
a9ea10ca7f
Move version of #getBounds() that handles children to Item, to eliminate duplicated code.
2011-04-28 10:04:36 +01:00
Jürg Lehni
6468732d96
Some changes to Key code, rename alt to option to go with Scriptographer, and check for paper.toolt to exist since it caused errors when reloading a page.
2011-04-28 08:49:56 +01:00
Jürg Lehni
26111da357
Use CanvasProvider in Document to produce canvas.
2011-04-28 08:49:05 +01:00
Jürg Lehni
81461764a5
Add conditional code to CanvasProvider, with a TODO for implementing functionality for the server.
2011-04-28 08:48:50 +01:00
Jürg Lehni
cf79080682
Move browser related code to browser folder and use conditionals to not include them when producing paper.js for server.
2011-04-28 08:48:28 +01:00
Jürg Lehni
6a483fa8be
Rename CurveLocation related functions to *At(offset), and add optional isParameter argument that defines whether offset is a length or a description of curve index / curve parameter.
2011-04-27 21:40:52 +01:00
Jürg Lehni
ea6cf24aae
Rename length parameter to more appropriate offset, to reflect recent name changes.
2011-04-27 21:23:57 +01:00
Jürg Lehni
3501e14c51
Remove comment about pending port that has been backported to Scriptographer.
2011-04-27 21:13:32 +01:00
Jürg Lehni
c2fbcbcaa8
Use Curve#getLength(from, to) rather than cloning and dividing.
2011-04-27 20:52:24 +01:00
Jürg Lehni
346493fb7c
Replace calls to getters with their internal property in all cases where getter does not perform additional magic.
2011-04-27 20:48:41 +01:00
Jürg Lehni
016f4c15aa
Rename CurveLocation#getLength() and #getCurveLength() to #getOffset() and #getCurveOffset(), and seperate Path#getLength([location]) into #getLength() and #_getOffset().
2011-04-27 20:08:57 +01:00
Jürg Lehni
b0a1f4b1a9
Add missing Path#getPoint(length).
2011-04-27 19:28:39 +01:00
Jürg Lehni
c836012d3d
Add CurveLocation#getTangent() and #getNormal() and use them in Path's versions.
2011-04-27 19:26:03 +01:00
Jürg Lehni
bf0bc81892
Fix various minor bugs in CurveLocation: We cannot rely on most of its field to always be set and need to call getters instead.
2011-04-27 19:24:40 +01:00
Jürg Lehni
cc06a6f128
Remove CurveLocation#getPath() again as its functionality is provided by #getItem() already.
2011-04-27 19:22:57 +01:00
Jürg Lehni
ebc9bc88c4
Use 0 instead of null for empty bit flag fields.
2011-04-27 19:11:22 +01:00
Jürg Lehni
c6d96784ba
Further simplify and compress code.
2011-04-27 18:16:32 +01:00
Jürg Lehni
f71967f3d3
Further simplify and compress code.
2011-04-27 17:57:56 +01:00
Jürg Lehni
6b6f27cb6e
Add TODOs about not returning -1 for undefined.
2011-04-27 17:53:59 +01:00
Jürg Lehni
4bfc56bb6d
Simplify and compress code a bit.
2011-04-27 17:53:23 +01:00
Jonathan Puckey
0700c51a85
Simplifications in Item#isDescendant & Item#isAncestor.
2011-04-27 16:16:05 +02:00
Jonathan Puckey
55fc2bc99c
Some minor changes to Item.
2011-04-27 16:10:23 +02:00
Jonathan Puckey
81a15379e5
Have Path#reverse also reverse the segment handles.
2011-04-27 15:49:06 +02:00
Jürg Lehni
ccbdb2abe3
Make preventDefault() work on IE too.
2011-04-27 12:41:52 +01:00
Jürg Lehni
ae3ec6f2d7
Remove comment about pending port that has been backported to Scriptographer.
2011-04-27 12:36:04 +01:00
Jürg Lehni
9671ac6dbc
Remove comment about pending port that has been backported to Scriptographer.
2011-04-27 12:30:17 +01:00
Jürg Lehni
e6a0f48256
Further clean-up code, as we only need previous / next references inside one sub-condition.
2011-04-27 12:26:10 +01:00
Jürg Lehni
138ec7d93c
No need to perform cyclic looping here now, since #getNext/Previous() does that for us.
2011-04-27 12:24:04 +01:00
Jürg Lehni
a251a24347
Add some TODOs to check.
2011-04-27 12:21:47 +01:00
Jürg Lehni
0e89466a11
Add cyclic looping to Segment#previous/next for closed paths.
2011-04-27 12:21:31 +01:00
Jürg Lehni
92369bf14f
Seperate the private Segment#is/setSelected(point) methods from the newly added getter / setter.
2011-04-27 12:15:51 +01:00
Jürg Lehni
6204eef643
Remove comment about pending port that has been backported to Scriptographer.
2011-04-27 12:08:13 +01:00
Jürg Lehni
776edda51d
Cleaned-up Segment#is/setSelected() code a bit.
2011-04-27 12:06:44 +01:00
Jürg Lehni
cd2347aa9b
Remove comment about pending port that has been backported to Scriptographer.
2011-04-27 11:24:13 +01:00
Jürg Lehni
41eb09f15f
Add forgotten brackets in Curve#isSelected() and remove comments about backporting as it is ported now.
2011-04-27 10:52:56 +01:00
Jürg Lehni
1c9cd9ace4
Clean up code in #setContextStyles().
2011-04-27 09:53:53 +01:00
Jürg Lehni
b7a4277143
Add comment about _x / _y properties and clean up code a bit.
2011-04-26 17:57:12 +01:00
Jürg Lehni
ead1600afe
Clean-up CurveLocation code and switch from returning -1 to null for #getIndex().
2011-04-26 17:49:54 +01:00
Jürg Lehni
c4ede92e81
Fix error in Path#getLastCurve().
2011-04-26 17:48:36 +01:00
Jürg Lehni
77ad25ffba
Clean up port comments.
2011-04-26 17:47:30 +01:00
Jürg Lehni
ac5dca4fc0
Update various comments about TODOs.
2011-04-26 17:04:15 +01:00
Jürg Lehni
84d321bd56
Clean up comments.
2011-04-26 15:56:06 +01:00
Jürg Lehni
9ed0254cde
Make sure global paper point works during bootstraping of library already.
2011-04-26 15:53:19 +01: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
Jürg Lehni
189182b77c
Rename loop function to frame.
2011-04-26 15:16:05 +01:00
Jürg Lehni
a20f988511
Minor code cleanup.
2011-04-26 12:55:20 +01:00
Jürg Lehni
ba0c6dafea
Add paper.debug switch, set it to true by default when loading code through load.js and use it to ignore focus / blur events in Event.requestAnimationFrame() during development.
2011-04-26 12:48:46 +01:00
Jürg Lehni
9d2459d799
Rename '// Todo' to '// TODO', which is the convention.
2011-04-26 12:39:48 +01:00
Jürg Lehni
f431dcab5c
Add test code for dirty rectangle performance, deactivated by a boolean switch.
2011-04-26 12:37:37 +01:00
Jürg Lehni
e8a2a786e0
Fix Curve#getParameter() for straight lines.
2011-04-26 12:30:58 +01:00
Jürg Lehni
6609dc2307
Implement new root finding algorithm, combining Newton-Raphson Method with Bisection, and update Curve#getParameter() to use it.
2011-04-26 12:23:09 +01:00
Jürg Lehni
7868bc1bdc
Remove obsolete comma.
2011-04-26 11:30:29 +01:00
Jonathan Puckey
e52ed9ae36
Key handlers: allow the user to prevent the default behaviour of key events.
2011-04-25 18:11:01 +02:00
Jonathan Puckey
1efb69e46f
Key: small change to a todo comment.
2011-04-25 17:42:37 +02:00
Jonathan Puckey
778997ec18
Simplify Key further and fix ToolEvent#getModifiers.
2011-04-25 17:38:40 +02:00
Jonathan Puckey
404bbac3a5
Key: remove logging statement.
2011-04-25 17:30:24 +02:00
Jonathan Puckey
5d15c3dfef
Simplify ToolEvent#getModifiers() & small cleanup in Key.
2011-04-25 17:26:58 +02:00
Jonathan Puckey
a96bb326f4
Some more simplifications in Key.
2011-04-25 17:16:45 +02:00
Jonathan Puckey
95bfebf64b
Simplify Key a bit.
2011-04-25 17:08:08 +02:00
Jonathan Puckey
2e43fb0997
Key: add type to the key event.
2011-04-25 14:57:06 +02:00
Jonathan Puckey
05a138bc7b
Implement onKeyDown / onKeyUp & Key#isDown(key).
2011-04-25 14:52:45 +02:00
Jonathan Puckey
1e4ae9afb4
Simplify ToolEvent#modifiers.
2011-04-25 12:05:18 +02:00
Jonathan Puckey
22bc08501e
Implement ToolEvent#modifiers.
2011-04-25 11:52:52 +02:00
Jonathan Puckey
5e6630a1f3
Speed up drawHandle function.
2011-04-23 15:56:27 +02:00
Jonathan Puckey
f261da3279
Document#getSelectedItems: add todo.
2011-04-23 14:32:21 +02:00
Jürg Lehni
092c893d38
Merge remote-tracking branch 'origin/master'
2011-04-22 16:32:32 +01:00
Jürg Lehni
28c9254695
Rename onFrameLoop to onFrame.
2011-04-22 16:31:46 +01:00
Jonathan Puckey
538f360a6b
Fix Document#getSelectedItems & Path#setSegments.
2011-04-22 12:30:38 +02:00
Jonathan Puckey
4d89d6c235
Path#setSegments: reset _selectedSegmentCount when setting a new segment list.
2011-04-22 11:39:12 +02:00
Jonathan Puckey
11063af8df
CompoundPath cleanups.
2011-04-21 21:12:48 +02:00
Jonathan Puckey
1ea0a811b5
Use internal variables in CompoundPath#moveBy and Segment#isSelected.
2011-04-21 21:06:35 +02:00
Jonathan Puckey
af0543dac8
Some cleanups in Path.
2011-04-21 21:01:31 +02:00
Jonathan Puckey
dfb5cbc5eb
Fix two bugs in the selected items code.
2011-04-21 20:52:28 +02:00
Jonathan Puckey
be8ee90f75
Document: use a hash for Document#_selectedItems to speed up adding to and removing from it.
2011-04-21 20:43:42 +02:00
Jonathan Puckey
745f002cd3
Segment: add todo.
2011-04-21 20:00:11 +02:00
Jonathan Puckey
abb0878a25
Curve: Implement selection of curves.
2011-04-21 19:54:32 +02:00
Jonathan Puckey
cf541901dd
Rename getSelected methods to isSelected.
2011-04-21 19:51:49 +02:00
Jonathan Puckey
d831d66758
Implement SelectionState.js: bitwise flags for segment selection state.
2011-04-21 19:37:51 +02:00
Jonathan Puckey
7867a46c35
Path#setSelected: do XOR correctly.
2011-04-21 18:45:36 +02:00
Jonathan Puckey
cf2faa14e3
Path#join: use internal variables.
2011-04-21 18:43:22 +02:00
Jonathan Puckey
ff9976ab57
Implement Document#getSelectedItems.
2011-04-21 18:10:47 +02:00
Jonathan Puckey
73b97dbfba
Implement segment point selection.
2011-04-21 18:06:06 +02:00
Jonathan Puckey
732caec7bf
Speed up drawing of selected items.
2011-04-21 15:48:21 +02:00
Jonathan Puckey
517793c48a
Implement Item#get/setDocument and Document#selectedItems.
2011-04-21 15:47:00 +02:00
Jonathan Puckey
b2cd8cdec2
Path: use the internal SegmentPoint#_x and #_y properties where possible.
2011-04-21 15:25:25 +02:00
Jürg Lehni
985aa5aff8
Directly access internal _x and _y properties on internal SegmentPoints, to avoid callling getters.
2011-04-21 13:33:12 +01:00
Jürg Lehni
96f266b4d2
Add beginning of SegmentPoint class.
2011-04-21 13:21:56 +01:00
Jürg Lehni
00958afd09
Explain lookup tables in Numerical.
2011-04-21 12:37:35 +01:00
Jonathan Puckey
1d92aea8e2
Fix Item#setSelected.
2011-04-20 16:00:08 +02:00
Jonathan Puckey
3fcfe3adbb
Implement drawing of selection of PlacedSymbol & Raster items.
2011-04-18 18:46:39 +02:00
Jonathan Puckey
be9f312110
Implement a first version of drawing path selection.
2011-04-17 18:46:35 +02:00
Jonathan Puckey
74cee4abef
Implement Path#remove() and add tests for it.
2011-04-13 16:16:32 +02:00
Jonathan Puckey
6d4d07f2a8
Path.Constructors: simply Path.Star constructor.
2011-04-13 00:05:46 +02:00
Jonathan Puckey
8a113a1c84
Item: clean up white space.
2011-04-12 14:37:52 +02:00
Jonathan Puckey
0d4517c77f
Path: add todos for missing functions.
2011-04-12 14:36:02 +02:00
Jonathan Puckey
60dca8c2e8
Path#cubicCurveTo: convert arguments to points first.
2011-04-12 14:35:42 +02:00
Jonathan Puckey
91d8dd1187
Path: add todos for missing functions.
2011-04-12 14:28:18 +02:00
Jonathan Puckey
491250ef14
Simplify Path.Star constructor.
2011-04-12 14:20:56 +02:00
Jonathan Puckey
12de77eb42
Path.Constructors: implement Path.Star and add tests.
2011-04-12 14:18:00 +02: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
Jonathan Puckey
2a9bbd3dee
Fix Path#closePath & CompoundPath#closePath.
2011-04-11 23:33:08 +02:00
Jonathan Puckey
499c421021
Implement Path#join(path) and add tests for it.
2011-04-11 23:30:08 +02:00
Jonathan Puckey
d02885cba7
Implement Item#isParent and add tests for it.
2011-04-11 19:42:03 +02:00
Jonathan Puckey
594c11fedd
CurveLocation: fix mistakes.
2011-04-11 19:36:40 +02:00
Jonathan Puckey
aa043428c0
CurveLocation: add empty line to end of file.
2011-04-11 19:33:34 +02:00
Jonathan Puckey
b46c6d0a29
Curve: implement getLocation(length), getLength(location), getTangent(length), getNormal(length)
2011-04-11 19:32:19 +02:00
Jonathan Puckey
d396f48c4b
Implement CurveLocation.
2011-04-11 19:32:04 +02:00
Jonathan Puckey
5f05c85b42
Gradient: rename midPoint to rampPoint.
2011-04-07 17:12:00 +02:00
Jonathan Puckey
c875953198
Merge remote branch 'origin/master'
2011-04-07 17:03:33 +02:00
Jonathan Puckey
06df8b1288
Allow Gradient constructor to receive an array of colors or [color, midPoint]. Also allow the user to specify the type of the gradient in the constructor.
2011-04-07 17:01:49 +02:00
Jürg Lehni
08d0499251
Change comment.
2011-03-25 19:58:20 +02:00
Jürg Lehni
e83195bb8f
Add #first/lastCurve getters.
2011-03-25 19:58:02 +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
14010eb8b2
Format abscissas array for better reading.
2011-03-21 12:46:00 +00:00
Jürg Lehni
417d015eab
Improve curve time parametrization precision by iteratively adding up sub-range lengths, and optimise speed by determining integration precision based on range size.
2011-03-20 11:38:06 +00:00
Jürg Lehni
a794816097
Fix wrong number of iterations in False Position method.
2011-03-20 02:03:26 +00:00
Jürg Lehni
11e70c5069
Use fast Newton-Raphson Method for now.
2011-03-20 02:02:02 +00:00
Jürg Lehni
0620a19eb9
Use False Position method as fall back in Newton-Raphson method, for accurate results in rare sitatuations wher the fast Newton-Raphson method fails.
2011-03-20 02:01:17 +00:00
Jürg Lehni
02328287cb
Use n=16 evaluations in integrations for now.
2011-03-20 02:00:15 +00:00
Jürg Lehni
500942e86d
Improve Numerical.integrate() by adding higher precision and supported iterations of up to n = 16.
2011-03-20 01:59:53 +00:00
Jürg Lehni
7ae504e51f
Add support for Item#removeOnMove().
2011-03-20 00:11:02 +00:00
Jürg Lehni
ad71293983
Remove Van Wijngaarden–Dekker–Brent method again as it led to imprecise results, and experiment with the very fast Newton-Raphson method (keeping False Position as a possible fallback for now).
2011-03-20 00:04:33 +00:00
Jürg Lehni
2c9d168224
Clean up and improve Path drawing commands.
2011-03-19 23:09:17 +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
4e65d2c1d3
Fix simple syntax error.
2011-03-15 12:30:44 +01:00
Jürg Lehni
db1e7e8880
Simple optimisations.
2011-03-14 22:38:40 +01:00
Jürg Lehni
3a8bdeb19b
Move scroll bounds code to Element.getScrollBounds().
2011-03-14 22:37:31 +01:00
Jürg Lehni
ca9e70ade0
Request next animation frame at beginning of callback.
2011-03-14 22:35:31 +01:00
Jürg Lehni
2fcca38a9c
Add support for onFrameLoop() callback to PaperScript.
2011-03-14 22:34:09 +01:00
Jürg Lehni
8179d7bf7e
Clean up Event.requestAnimationFrame.
2011-03-14 22:19:06 +01:00
Jürg Lehni
6d8379f885
Separate Events into Event and Element object, add a row of useful Element helper functions and define experimental Event.requestAnimationFrame().
2011-03-14 22:14:20 +01:00
Jürg Lehni
aae88d7568
Optimise chained return statements.
2011-03-14 22:13:01 +01:00
Jürg Lehni
f02b7031a9
Reintroduce accidentally removed definition of _readNull: true.
2011-03-14 22:08:07 +01:00
Jürg Lehni
a48c130965
Improve comments.
2011-03-14 22:07:21 +01:00
Jürg Lehni
a2a9646d02
Merge remote-tracking branch 'origin/master'
2011-03-14 16:18:28 +01:00
Jürg Lehni
c284b0837e
Fix tiny error in Path#smooth()
2011-03-14 16:18:12 +01:00
Jonathan Puckey
46ee4c517d
Optimize nameToRGBColor to also handle strings like rgb(0, 0, 0).
2011-03-14 13:54:57 +01:00
Jürg Lehni
bfd43b27fa
Improve commens and get rid of for loop to in nameToRGBColor().
2011-03-13 23:00:01 +01:00
Jürg Lehni
1c8c64c473
One more nameToRGBColor() simplification, by reversing return logic.
2011-03-13 22:57:01 +01:00
Jürg Lehni
a842b5faa6
Simplify nameToRGBColor() further: No need to create function in its own scope, simply use the inject scope to contain cache and context variables.
2011-03-13 22:55:20 +01:00
Jürg Lehni
21aa12271e
Simplify nameToRGBColor() code a little: Shorter variables names, no need to save and restore context, as all we do is fillRect().
2011-03-13 22:53:32 +01:00
Jürg Lehni
873e715361
Merge remote-tracking branch 'origin/master'
2011-03-13 22:48:17 +01:00
Jürg Lehni
c8449162d8
Remove unnecessary checks for rect.
2011-03-13 22:48:07 +01:00
Jonathan Puckey
e0753179e3
Clean up last commit a bit.
2011-03-13 20:16:04 +01:00
Jonathan Puckey
0d173e39bf
Merge remote branch 'origin/master'
2011-03-13 20:15:00 +01:00
Jonathan Puckey
b004a83361
Color: avoid huge named color lookup table by drawing the named color on a canvas and reading its components.
2011-03-13 20:14:16 +01:00
Jürg Lehni
cd80db14d8
Rearrange color converters to group by pairs.
2011-03-13 18:41:32 +01:00
Jürg Lehni
d5fa3d7ae6
Merge remote-tracking branch 'origin/master'
...
Conflicts:
src/item/Raster.js
2011-03-13 18:34:05 +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
1cd6daada1
Use _item instead of item as internal reference to PathStyle's item.
2011-03-13 18:29:59 +01:00
Jonathan Puckey
5079259a8e
Small change to Color.
2011-03-12 15:16:17 +01:00
Jonathan Puckey
d7399926a0
Allow for Raster#setPixel(x, y, color).
2011-03-11 14:23:30 +01:00
Jonathan Puckey
b643fdfc1f
Implement Item#removeOn and Item#getId.
2011-03-09 19:35:03 +01:00
Jonathan Puckey
fed52bd521
Paperscript#run: keep tool on global the paper object.
2011-03-09 19:33:53 +01:00
Jürg Lehni
c7cefcba3a
Merge remote-tracking branch 'origin/master'
2011-03-09 18:17:50 +00:00
Jürg Lehni
427e969d3d
Add data access to Raster, untested.
2011-03-09 18:17:12 +00:00
Jonathan Puckey
dae2d6acb1
Remove todo in PlacedSymbol.
2011-03-09 17:09:23 +01:00
Jonathan Puckey
df0c95e41f
Fix bug in Tool.js.
2011-03-09 16:51:50 +01:00
Jonathan Puckey
f57a7ba0d9
Use Math.min / Math.max to clamp component values in color classes.
2011-03-09 16:48:53 +01:00
Jonathan Puckey
08d66ae231
Color: small change.
2011-03-09 15:50:32 +01:00
Jonathan Puckey
87de9f4fa8
Further refactoring in Color.
2011-03-09 15:25:41 +01:00
Jonathan Puckey
30d2f16c8c
Color: save a var statement.
2011-03-09 15:00:13 +01:00
Jonathan Puckey
da92ff9773
Check for min and max values in the different color component setters.
2011-03-09 14:48:16 +01:00
Jürg Lehni
41ce6279f1
Merge remote-tracking branch 'origin/master'
...
Conflicts:
src/color/Color.js
2011-03-09 13:34:13 +00:00
Jürg Lehni
9fd0381b82
Minor clean-ups.
2011-03-09 13:31:40 +00:00
Jonathan Puckey
b7902635bf
Color#setAlpha: comment out code using Math.min and Math.max, which was supposed to just be there to explain what is happening.
2011-03-09 14:31:30 +01:00
Jonathan Puckey
bda24fbd54
Color: simplify stringToRGB again.
2011-03-09 14:29:19 +01:00
Jonathan Puckey
eacf346aab
Color: reintroduce hexToRGB to be called from stringToRGB.
2011-03-09 14:23:18 +01:00
Jonathan Puckey
741652aa9c
Color: combine stringToRgb, namedToRgb and hexToRgb and optimize a bit.
2011-03-09 14:20:09 +01:00
Jonathan Puckey
526711ffd4
Fix and improve performance of Raster#getPixel.
2011-03-09 13:38:58 +01:00
Jonathan Puckey
00c4b5ee34
Small change to HSBColor#setHue.
2011-03-09 02:30:50 +01:00
Jonathan Puckey
6a26cf3228
Add HSBColor to load.js.
2011-03-09 02:24:35 +01:00
Jonathan Puckey
62db3e56dd
Implement HSBColor, introduce Color#convert(type) and refactor color classes.
2011-03-09 02:23:39 +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
72469dc65f
Clean up PlacedSymbol constructor, make sure it declares parameters.
2011-03-08 17:21:05 +00:00
Jürg Lehni
195b089424
Clean up Path.* constructors and make sure they handle Base.read() returning null.
2011-03-08 17:20:30 +00:00
Jürg Lehni
484b2b0c94
Test code for Path#segments change observation.
2011-03-08 17:20:03 +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
ea9a1d2c47
Fix Base.read() to correctly read existing objects even when length > 1.
2011-03-08 17:08:30 +00:00
Jürg Lehni
74167ff28d
Add test code for segments list that detects change.
2011-03-08 13:19:08 +00:00
Jürg Lehni
fc0d3efd29
Simplify Path constructor further.
2011-03-08 13:03:57 +00:00
Jürg Lehni
e35fb1efb6
Move populating of segments list to Path#setSegments() and rely on it in constructor.
2011-03-08 13:03:11 +00:00
Jürg Lehni
848befe103
No need to create a new segments array in setSegments, just set length of existing one instead.
2011-03-08 13:00:32 +00:00
Jürg Lehni
7a4e49c5d5
Clean up Document#draw a bit and define param outside of loop.
2011-03-08 12:55:52 +00:00
Jürg Lehni
456e9f2815
Use variable definition chaining in Raster.
2011-03-08 12:55:34 +00:00
Jürg Lehni
6a67052090
Update copyright / licensing comments.
2011-03-08 01:41:50 +00:00
Jürg Lehni
34a6c7871c
Clean-up loading code.
2011-03-08 01:07:26 +00:00
Jürg Lehni
2e55cd9871
Clean up source loading sequence, and rename test_function.js to helpers.js
2011-03-08 01:05:01 +00:00
Jürg Lehni
4680283ce7
Simply use document.write() for script loading, as load.js seems not ready for primetime yet (it magically half-broke QUnit on Safari).
2011-03-08 00:58:47 +00:00
Jürg Lehni
de797aa0fe
Improve load.js mechanism and make it work for QUnit too.
2011-03-08 00:17:42 +00:00
Jürg Lehni
8f78513174
Change naming of exported PaperScript methods.
2011-03-08 00:17:19 +00:00
Jürg Lehni
798bcd709a
Since Firefox does not seem to support the <base> tag for script loading, roll our own solution through the load.js calls.
2011-03-07 23:11:41 +00:00
Jürg Lehni
3dd523a683
Merge remote-tracking branch 'origin/master'
2011-03-07 18:37:03 +00:00
Jürg Lehni
e32549aaf2
Switch to using load.js for loading the various parts of the library during development.
2011-03-07 18:36:42 +00:00
Jürg Lehni
6db184341a
Fix a small syntax error.
2011-03-07 18:36:13 +00:00
Jürg Lehni
b4356078a7
Export PaperScript.install, so it can be loaded after onload.
2011-03-07 18:35:48 +00:00
Jürg Lehni
3685a614a5
Add copyright / license comment to main file and include Line.js and BlendMode.js in compiled library.
2011-03-07 18:34:17 +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
c4c5b070b5
Minor code clean-up.
2011-03-07 16:51:12 +00:00
Jürg Lehni
2a0c393b85
Simplify HSB code a little.
2011-03-07 16:51:00 +00:00
Jürg Lehni
350fef00ec
Simplify new getter / setter generation code a bit.
2011-03-07 16:49:24 +00:00
Jürg Lehni
ff2b740c68
Use local references to often called Math functions, allowing uglify to shorten them further.
2011-03-07 16:49:02 +00:00
Jonathan Puckey
d713102734
Implement Color#saturation / Color#hue / Color#brightness and allow chaining of color channel setters.
2011-03-07 15:59:35 +01:00
Jonathan Puckey
513bd1da67
Merge remote branch 'origin/master'
2011-03-07 13:42:58 +01:00
Jonathan Puckey
69829e03f6
Rectangle: optimize creation of corner getters / setters and combine multiple variable declarations.
2011-03-07 13:42:50 +01:00
Jürg Lehni
8895209e3b
Merge remote-tracking branch 'origin/master'
2011-03-07 12:01:33 +00:00
Jürg Lehni
59cb7e937e
Add control over maximum iterations to Numerical.findRoot().
2011-03-07 11:59:43 +00:00
Jonathan Puckey
5e99833ebb
Merge remote branch 'origin/master'
2011-03-07 12:59:08 +01:00
Jürg Lehni
d9b8809f3c
Further clean up getParameter() code.
2011-03-07 11:58:41 +00:00
Jonathan Puckey
1b7dbd659d
Compress Rectangle corner getters and setters.
2011-03-07 12:58:00 +01:00
Jürg Lehni
7956b50886
Use === for undefined comparisons.
2011-03-07 11:52:04 +00:00
Jürg Lehni
1e8dffac08
Clean up getParameter() code.
2011-03-07 11:51:01 +00:00
Jürg Lehni
0ddfc9ef33
Add support for sub ranges and negatives lengths in Curve#getParameter(), a prerequirement for adding dash support.
2011-03-07 11:37:42 +00:00
Jürg Lehni
2ac9a13e2a
Give Numerical methods more meaningful names.
2011-03-07 11:12:00 +00:00
Jürg Lehni
f5c79bf709
Clean up PaperScript code a bit.
2011-03-07 11:10:45 +00:00
Jürg Lehni
6d8c7787bd
Export ToolEvent too.
2011-03-07 11:08:58 +00:00
Jürg Lehni
26caf099ca
No need for all the .0 in brent() code.
2011-03-07 02:43:07 +00:00
Jürg Lehni
08545983d7
Minor clean-ups.
2011-03-07 02:38:07 +00:00
Jürg Lehni
4dd4072f6b
Use push() instead fo concat() for better getParameter() performance.
2011-03-07 02:35:06 +00:00
Jürg Lehni
3d7e66053c
Simplify getLength() for line ranges.
2011-03-07 02:33:36 +00:00
Jürg Lehni
172212c222
Clean-up code and comments.
2011-03-07 02:28:49 +00:00
Jürg Lehni
add0bcf1fd
Yet more optimisations in getParameter(), both for straight lines and curves.
2011-03-07 02:26:59 +00:00
Jürg Lehni
0e8c346888
Further optimise getParameter() / getLength() code by reusing a integrand function and taking advantage of integral ranges.
2011-03-07 02:22:33 +00:00
Jürg Lehni
3447d11a6f
Some minor clean-ups.
2011-03-07 01:40:18 +00:00
Jürg Lehni
027a5e67b9
Add getLength() optimisation for straight lines.
2011-03-07 01:37:18 +00:00
Jürg Lehni
f7f5a70b1c
Fix recently newly introduced bug in getStrokeBounds().
2011-03-07 01:30:45 +00:00
Jürg Lehni
e1a7aff2f0
Add copyright notice and license file.
2011-03-07 00:50:44 +00:00
Jürg Lehni
91160bc5d7
Add copyright notices.
2011-03-07 00:40:48 +00:00
Jürg Lehni
003cfbd32b
Format Gauss tables nicer.
2011-03-07 00:38:33 +00:00
Jürg Lehni
0bfca81140
Clean-up getBounds() code and move to its own scope at the end of Path.
2011-03-07 00:36:44 +00:00
Jürg Lehni
9fdbd0146d
Rename MathUtils to Numerical.
2011-03-07 00:21:04 +00:00
Jürg Lehni
58f5c8554e
Add comments about initial guess.
2011-03-07 00:17:43 +00:00
Jürg Lehni
83fea3bf4e
Clean up MathUtils code.
2011-03-07 00:17:32 +00:00
Jürg Lehni
65900f8790
Implement Curve#getParameter() using MathUtils.brent(), with the astonishing result that performance can match the Java side on Chrome!
2011-03-07 00:00:45 +00:00
Jürg Lehni
b1e90efc9e
Add Van Wijngaarden–Dekker–Brent method for root finding, ported from Numerical Recipes in C.
2011-03-06 23:25:57 +00:00
Jürg Lehni
29e57cc521
Replace slow simpson() method with insanely fast Gauss-Legendre Numerical Integration by Jim Armstrong which was further optimised.
2011-03-06 23:24:33 +00:00
Jürg Lehni
c4ad95b0ac
More variable chaining...
2011-03-06 22:06:24 +00:00
Jürg Lehni
4c13ca6961
Fix syntax errors (that magically work on Safari).
2011-03-06 22:06:06 +00:00
Jürg Lehni
87981efeb5
Massive refactoring of transform() / getBounds() code: getBounds() / getStrokeBounds() now supports an optional Matrix parameter which is used to on the fly transform all coordinates and stroke definitions before bounds are calculated. This even supports the correct determination of rotated ellipse bounds for round strokes in symbols.
2011-03-06 21:26:38 +00:00
Jürg Lehni
6def2b9d3a
Clean-up Path#arcTo() code.
2011-03-06 21:13:55 +00:00
Jürg Lehni
2d4cf2cc72
Replace beans access to Item#position with getter calls.
2011-03-06 21:12:11 +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
90b94a8d83
Various simplificiations and clean-ups in Path constructors.
2011-03-06 18:46:28 +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
4070f98374
Clean up calculateBounds().
2011-03-06 18:33:52 +00:00
Jürg Lehni
836da3ce47
Make getCurrentSegment() a real private.
2011-03-06 15:21:12 +00:00
Jürg Lehni
dfb11610e7
Define getCurrentSegment() as private and make sure it's not used as a bean.
2011-03-06 15:17:06 +00:00
Jürg Lehni
162dab66a7
Clean up code.
2011-03-06 15:15:21 +00:00
Jürg Lehni
e533b4edbb
Move PostScript commands to the end of Path definition in its own injection block.
2011-03-06 15:15:13 +00:00
Jürg Lehni
f803e1ad1d
Remove obsolete comment.
2011-03-06 15:14:57 +00:00
Jürg Lehni
501e42fb9d
Add Path#getLength().
2011-03-06 14:58:10 +00:00
Jürg Lehni
8b32aa9f09
Reactivate commented out code in addBevelJoin(), since it is required in some situations.
2011-03-06 14:51:46 +00:00
Jürg Lehni
78c7f645ab
Merge remote-tracking branch 'origin/master'
2011-03-06 14:45:57 +00:00
Jürg Lehni
2df6dc989a
Add comments about changes that need backporting to Scriptographer.
2011-03-06 14:45:44 +00:00
Jürg Lehni
f6a8de8cc6
Finish work on miter caps for Path#getStrokeBounds.
2011-03-06 14:45:32 +00:00
Jürg Lehni
15b16aaed9
Add Line class to basics.
2011-03-06 14:45:07 +00:00
Jonathan Puckey
130d9ebb23
Merge remote branch 'origin/master'
2011-03-06 15:45:03 +01:00
Jürg Lehni
8be1041011
Make style setter calls chainable.
2011-03-06 14:44:54 +00:00
Jonathan Puckey
40b7571489
Move BlendMode into util and add missing var.
2011-03-06 15:44:51 +01:00
Jürg Lehni
2c034475b0
Fix a bug in Point#cross().
2011-03-06 14:26:23 +00:00
Jonathan Puckey
54c1f3d8b1
Fix Raster#setSize.
2011-03-06 15:08:41 +01:00
Jonathan Puckey
336c9e1441
Fix bug in setHidden where Item#visible was being interpreted as a bean.
2011-03-06 14:50:57 +01:00
Jürg Lehni
5507482d8f
Add support for bevel joins to Path#getStrokeBounds, miter still pending.
2011-03-06 13:26:36 +00:00
Jürg Lehni
407b6d8d33
Add Curve#getPrevious / Next.
2011-03-06 13:26:09 +00:00
Jürg Lehni
de9a406dc0
Add support for all strokeCaps in getStrokeBounds, joins are still pending.
2011-03-06 13:11:25 +00:00
Jürg Lehni
15f124bd9c
Link segments to their curves through Segment#getCurve().
2011-03-06 13:11:04 +00:00
Jürg Lehni
eb09ec2442
Fix error in Curve evaluation.
2011-03-06 13:07:49 +00:00
Jürg Lehni
e19c3bf3c2
Define Curve#toString() and Curve#clone()
2011-03-06 12:56:47 +00:00
Jürg Lehni
f98de38451
Correct Segment#toString()
2011-03-06 12:56:30 +00:00
Jürg Lehni
d15bf94f8f
Add curve evaluation methods, untested.
2011-03-06 12:52:13 +00:00
Jürg Lehni
00d58a3e61
Move Path#getCurveLength() to Curve#getLength() and update tests accordingly.
2011-03-06 12:29:17 +00:00
Jürg Lehni
3ca1e4a25e
Always update segments when index is set, as segments list might have shifted in the meantime.
2011-03-06 12:25:08 +00:00
Jürg Lehni
909b2a22ba
Begin implementing Path#curves list.
2011-03-06 12:24:15 +00:00
Jürg Lehni
474d79db17
Clean up Segment constructor and make sure internal point objects are never replaced, always updated instead.
2011-03-06 12:24:03 +00:00
Jürg Lehni
cb2e4aaa04
Imrove Point, Size and Rectangle constructors.
2011-03-06 12:15:15 +00:00
Jürg Lehni
fd0d409d9e
More work on Path#getStrokeBounds(), unfinished.
2011-03-06 11:42:33 +00:00
Jürg Lehni
0a690788ef
Allow chaining of Item transform functions.
2011-03-06 11:42:08 +00:00
Jürg Lehni
5a1d31bba7
Improve argument reading in PostScript drawing methods.
2011-03-06 11:23:21 +00:00
Jürg Lehni
56c10f9196
Fix Segment#getHandleIn/OutIfSet and a newly introduced drawing error in Path#draw.
2011-03-06 11:18:35 +00:00
Jürg Lehni
7bea7e36de
Make use of new Segment#getHandleIn/OutIfSet() where we can.
2011-03-06 11:04:41 +00:00
Jürg Lehni
b98abeb416
Declare outX, outY outside of draw loop, as it is used from previous iteration.
2011-03-06 11:00:25 +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
72a1ba8e70
Activate beans for Segment and clean up bean / getter / setter mess for point / handleIn / handleOut.
2011-03-06 10:57:14 +00:00
Jürg Lehni
e892d4446a
More variable definition chaining.
2011-03-06 10:15:06 +00:00
Jürg Lehni
49e828ab9d
Use chained variable definitions wherever we can to save space.
2011-03-06 10:14:12 +00:00
Jürg Lehni
3a51acec88
Begin implementing Path#getStrokeBounds().
2011-03-06 10:09:37 +00:00
Jürg Lehni
1607d744ef
Implicitely call document.redraw() at the end of PaperScript execution.
2011-03-05 22:02:53 +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
79d5a46cab
Make it clear it's an empty loop.
2011-03-05 14:26:52 +00:00
Jürg Lehni
06e870f69c
Improve some comments.
2011-03-05 14:26:16 +00:00
Jürg Lehni
cfb7d195c0
Use the new statics: true setting for Base injection, and fix Array.prototype.slice issue in Base.read().
2011-03-05 14:23:42 +00:00
Jürg Lehni
3f0a45a7c2
Allow Rasters to be created directly from id strings.
2011-03-05 14:17:32 +00:00
Jürg Lehni
8e25a951bc
Move Base.capitalize() and Base.read() out of Bootstrap core into Paper.js, so normal Bootstrap libs can work with it too.
2011-03-05 14:17:17 +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
cc134de058
Remove trailing collon.
2011-03-05 13:51:23 +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
e87e7b2582
Move get/setContext to get/setCanvas.
2011-03-05 01:59:01 +00:00
Jürg Lehni
a365bf45a4
Apply the same optimisation from previous commit to Layer.
2011-03-05 01:53:32 +00:00
Jürg Lehni
02bf012aa5
Simplify #appendTop / Bottom and #moveAbove / Bellow by using generator functions.
2011-03-05 01:50:56 +00:00
Jürg Lehni
083a9864f0
Use Matrix#transformBounds() in DocumentView#getBounds().
2011-03-05 01:42:24 +00:00
Jürg Lehni
4908ba5edf
Expand shortened name.
2011-03-05 01:37:02 +00:00
Jürg Lehni
ce74516228
Remove more beans access, this time related to various PathStyle getters / setters.
2011-03-05 01:36:27 +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
b1027dbb38
Use better variable name.
2011-03-05 00:24:32 +00:00
Jürg Lehni
1d858147ec
Stop using style beans internally.
2011-03-05 00:23:16 +00:00
Jürg Lehni
1d866ecb6c
Clean up internal properties and beans in Color related classes.
2011-03-05 00:16:26 +00:00
Jürg Lehni
44ab8ed3a0
Refer to currentStyle through getters and setters, not through beans.
2011-03-05 00:03:28 +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
815e35fda6
Fix Segment#toString().
2011-03-04 23:55:49 +00:00
Jürg Lehni
342c5911c1
Add Events.getOffset(), to return coordinates relative to the target element's position.
2011-03-04 23:46:16 +00:00
Jürg Lehni
8d5024523c
Add Path#first/lastSegment.
2011-03-04 23:33:37 +00:00
Jürg Lehni
298dc912f3
Convert Tool to using new Events object instead of realing on full Bootstrap.
2011-03-04 23:32:46 +00:00
Jürg Lehni
ef1da14c0e
Use Events object to install 'load' event in PaperScript.
2011-03-04 23:32:11 +00:00
Jürg Lehni
b85235e1cb
Add Events object as a helper for installing and removing events.
2011-03-04 23:31:51 +00:00
Jürg Lehni
c25db2377f
Clean up Bootstrap core further and move Base.capitalize there.
2011-03-04 22:14:23 +00:00
Jürg Lehni
996af95ba3
Inline Bootstrap core into paper scope.
2011-03-04 22:03:43 +00:00
Jürg Lehni
7355c2d4a7
Switch to using Base.isArray.
2011-03-04 21:47:00 +00:00
Jürg Lehni
aa4892c0d8
Apply same optimisations from DOM methods in Item / Layer to Segment too.
2011-03-04 21:34:31 +00:00
Jürg Lehni
be6d60102c
Make sure Item#children is always checked for != null and simplify many of the DOM methods.
2011-03-04 21:34:14 +00:00
Jürg Lehni
e66dd46b9c
Start improving Item#clone() / #copyTo().
2011-03-04 20:57:16 +00:00
Jürg Lehni
f3663c04fe
Compress code using Base.each side-car.
2011-03-04 20:55:11 +00:00
Jürg Lehni
1bd0127ece
Remove dependency from full Bootstrap.
2011-03-04 20:54:57 +00:00
Jürg Lehni
93c3920505
Add definition of Base.capitalize() and remove dependencies of String#capitalize().
2011-03-04 19:46:41 +00:00
Jürg Lehni
702899b382
Fix a bug in #getFixedDistance() where equals was used on numbers (Java port left-over).
2011-03-04 19:16:25 +00:00
Jonathan Puckey
acb6e850a0
Use toCssString() in Color#getCanvasStyle.
2011-03-04 18:14:24 +01:00
Jürg Lehni
fb547a758f
Merge remote-tracking branch 'origin/master'
2011-03-04 16:55:01 +00:00
Jonathan Puckey
ff5ee13ba0
Fix Color#getCanvasStyle.
2011-03-04 17:54:36 +01:00
Jürg Lehni
66f5fcc847
Merge paper.js and build.js, to make sure the global paper object exists also when including seperate files during development and when running tests.
2011-03-04 16:52:17 +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
Jonathan Puckey
3837ca1f14
Have Path#setSegments convert elements in the passed array to segments.
2011-03-04 13:02:11 +01:00
Jonathan Puckey
c00f85c9e5
Merge remote branch 'origin/master'
2011-03-04 12:21:06 +01:00
Jonathan Puckey
81c5e0e4c8
Fix ToolHandler#getFixedDistance.
2011-03-04 12:20:53 +01:00
Jürg Lehni
6d00c723d9
Rename $operator() to more meaningful $eval().
2011-03-04 11:15:04 +00:00
Jürg Lehni
11672d104f
Align #include to the left.
2011-03-04 01:25:28 +00:00
Jürg Lehni
6f0f0cbd6b
Fix comments.
2011-03-04 01:23:47 +00:00
Jürg Lehni
7462a58903
Change missleading variable name.
2011-03-04 01:22:08 +00:00
Jürg Lehni
5a640b50f8
No need to export handleOperator() and handleSignOperator(), just use local privates.
2011-03-04 01:20:29 +00:00
Jürg Lehni
17aee283ec
Change sequence of handleOperator arguments for better readable resulting code.
2011-03-04 01:16:09 +00:00
Jürg Lehni
453da21bab
Test code for tool handlers and only create tool if they are present.
2011-03-04 01:13:21 +00:00
Jürg Lehni
c86eaf5684
Use nice formatting in produced code.
2011-03-04 01:09:22 +00:00
Jürg Lehni
be0d260cb4
Add support for Tool scripts in PaperScript.
2011-03-04 01:05:23 +00:00
Jürg Lehni
b80ba6fc86
Add support for canvas attribute in paperscript tags.
2011-03-04 00:58:10 +00:00
Jürg Lehni
6619447aa1
Convert ToolEvent type constants to Sg-style hyphenated lowercase strings.
2011-03-03 23:06:53 +00:00
Jürg Lehni
52ab361ed5
Include minified version of parse-js (25kb) inside PaperScript object.
2011-03-03 22:55:18 +00:00
Jürg Lehni
2b6dede883
Clean up white-spaces and line lengths.
2011-03-03 22:45:17 +00:00
Jürg Lehni
15a7b7e245
Add operator overloading through JS AST parsing and mangling to PaperScript.
2011-03-03 22:19:12 +00:00
Jürg Lehni
3324b083b7
Always execute PaperScripts on load, not on domready, as we want assets to be present as well.
2011-03-03 18:53:06 +00:00
Jürg Lehni
0b3c57ff88
Let paper be an instance of Base, and use its #extend() function to create scopes that inherit from paper but do not directly modify it.
2011-03-03 18:35:37 +00:00
Jürg Lehni
2c78a0a08b
Add beginning of support for <script type="text/paperscript">, inspired by Coffee Script.
2011-03-03 18:31:56 +00:00
Jürg Lehni
08970abd6d
Let paper.install() override existing values...
2011-03-03 18:31:18 +00:00
Jürg Lehni
cbe29fd02b
Rename Color#getCssString() to #toCssString(), to go with #toString().
2011-03-03 17:36:53 +00:00
Jürg Lehni
2f63a65ded
Clean up code.
2011-03-03 17:35:59 +00:00
Jürg Lehni
46a0589547
Use Error constructor correctly.
2011-03-03 17:29:40 +00:00
Jürg Lehni
484d74160b
Set private properties directly in initialize(), no need to call setters.
2011-03-03 17:27:56 +00:00
Jürg Lehni
0efc23b25c
Remove 2nd redundant definition of Gradient#getStops().
2011-03-03 17:26:30 +00:00
Jürg Lehni
7e52355f93
Rename Doc -> Document since paper code is namespaced now and does not clash with global Document prototype.
2011-03-03 17:23:27 +00:00
Jürg Lehni
fe1a01ecb6
Move paper.populate() functionality back to build.js.
2011-03-03 17:11:14 +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
5508e6eab6
Change scoped compilation of paper so that only a populated paper object is returned to the global scope, but nothing is installed yet.
2011-03-03 16:57:29 +00:00
Jürg Lehni
59dc0ae6d0
Make sure paper.* objects are only installed in the passed object if there is not already something under the same name.
2011-03-03 16:38:04 +00:00
Jürg Lehni
e9881c02fc
Merge remote-tracking branch 'origin/master'
2011-03-03 16:33:01 +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
dc75e14c59
Make sure utility objects stay in paper scope.
2011-03-03 16:32:39 +00:00
Jürg Lehni
aed8b0a6bc
Add utility objects to build.
2011-03-03 16:32:15 +00:00
Jürg Lehni
d088dc629e
Rename Paper to paper, implement it as an object literal and add paper.populate() and paper.install() methods that do the bootstraping.
2011-03-03 16:21:17 +00:00
Jonathan Puckey
00bf9aa88c
Fall back to Item#bounds if the Item doesn't have Item#strokeBounds in Item#draw.
2011-03-03 17:05:12 +01:00
Jürg Lehni
6923e168ab
Scope the compilation of the whole library and inject produced classes into global scope for now, add options later.
2011-03-03 14:09:20 +00:00
Jürg Lehni
80a5e4513e
Add preprocessor and build scripts for production of single file Paper.js version, based on previous work for Bootstrap.
2011-03-03 13:45:21 +00:00
Jonathan Puckey
2f9531810c
Implement todos about using strokeBounds instead of bounds.
2011-03-03 14:43:37 +01: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
c84df5a346
Use Segment.read() correctly in Path#initialize().
2011-03-03 13:16:14 +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
ecbd52cdf7
Fix Path.Line() constructor with 4 arguments.
2011-03-03 13:10:29 +00:00
Jürg Lehni
e089e080c2
Make Path#_add() handle both addition and insertion, and use it consequently so segment.path always gets correctly set.
2011-03-03 13:10:17 +00:00
Jürg Lehni
9a2462d147
No need to explicitely call Point#toString() in Segment#toString().
2011-03-03 13:03:57 +00:00
Jürg Lehni
d4d6d652ec
Rename Path#addSegment() to #_add(), to make sure it's supposed to be a private method.
2011-03-03 12:51:47 +00:00
Jürg Lehni
53b091b871
Rename #transformContent() to #_transform(), to make sure it's supposed to be a private method.
2011-03-03 12:47:55 +00:00
Jürg Lehni
1f29f6f104
Improve formating.
2011-03-03 12:46:50 +00:00
Jürg Lehni
b29a87653d
Replace % 2 with & 1 (modulo 2).
2011-03-03 12:46:31 +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
490ef78b53
Fix error in CompoundPath#closePath(): Forgot to pass 'this' to getCurrentPath().
2011-03-03 12:26:28 +00:00
Jürg Lehni
1d37c7b76f
Use 'that' variable for private instance method.
2011-03-03 12:25:41 +00:00
Jürg Lehni
26ebe2f2c0
Refacture CompoundPath to only use injection scope for methods that require getCurrentPath().
2011-03-03 12:23:46 +00:00
Jürg Lehni
07fcc000cf
Move the new refactored CanvasDraw functionality to static Item.draw() and #draw() instance methods on each prototype.
2011-03-03 12:19:43 +00:00
Jürg Lehni
54bb4d5527
Merge remote-tracking branch 'origin/master'
2011-03-03 10:55:39 +00:00
Jürg Lehni
964dc462e9
Add comments to Path#strokeBounds and scafolding for #controlBounds too.
2011-03-03 10:55:35 +00:00
Jonathan Puckey
136fe67917
Small change to CanvasDraw.
2011-03-03 02:25:09 +01:00
Jonathan Puckey
8ff04b6614
Unify canvas drawing commands in CanvasDraw.js and rework compositing code.
2011-03-03 02:22:21 +01:00
Jürg Lehni
91ec37de9c
Add foundations for Path#strokeBounds support.
2011-03-02 17:27:20 +00:00
Jürg Lehni
620cb2c754
Various clean-ups in Path.
2011-03-02 17:23:45 +00:00
Jürg Lehni
dbbefa9526
index on master: fd4b7b7
Include DocumentView.js in all examples and tests.
2011-03-02 16:22:26 +00:00
Jürg Lehni
ab9d07501e
Simplify code a bit, by chainging variable declarations.
2011-03-02 16:08:11 +00:00
Jürg Lehni
5d680b1987
Reformat code and add comment about clearRect dimensions.
2011-03-02 16:07:44 +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
8cb3efb28e
Simplify calculation of total in getAverageColor().
2011-03-02 08:53:38 +01:00
Jürg Lehni
98de3cbb2a
Simplify getAverageColor() loop.
2011-03-02 08:52:39 +01: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
a93156ec45
Break long lines at 80 chars.
2011-02-28 20:24:15 +01:00
Jürg Lehni
caa6e8f88e
Add comment about necessity to write more comments (nudge nudge, wink wink).
2011-02-28 20:23:03 +01:00
Jürg Lehni
aca79fc6a9
Simplify and optimise bounds calculations in Raster#transformContent().
2011-02-28 20:22:11 +01:00
Jürg Lehni
0305c91e8c
Change array format.
2011-02-28 20:21:21 +01:00
Jürg Lehni
d442ab1d71
Replace * 0.5 optimisations with more obvious / 2, as there is no need for such optimisation here.
2011-02-28 20:20:44 +01:00
Jürg Lehni
c3d02bbd16
Add explanatory comments to Raster#transformContent().
2011-02-28 20:17:59 +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
14b8452bad
Fix mistakes in Tool.js
2011-02-28 19:29:32 +01:00
Jonathan Puckey
1261dc03df
Doc: point to the correct performance test url.
2011-02-28 18:41:46 +01:00
Jonathan Puckey
eee5e63a72
BlendMode: support DocumentView and return if an item's bounds is null.
2011-02-28 18:36:06 +01:00
Jonathan Puckey
0e011dee2a
Support DocumentView in Group#draw.
2011-02-28 18:35:12 +01:00
Jonathan Puckey
fe9853852a
Implement new Doc(size) constructor, Doc#views / Doc#activeView and support DocumentView in Doc#redraw.
2011-02-28 18:34:39 +01:00
Jonathan Puckey
285f81f363
Support PlacedSymbol opacity.
2011-02-28 18:31:51 +01:00
Jonathan Puckey
4fa293ec6d
Have Tool convert points from view coordinates to artwork coordinates.
2011-02-28 18:31:03 +01:00
Jonathan Puckey
74f797a9dd
Clean up whitespace.
2011-02-28 18:30:08 +01:00
Jonathan Puckey
84e31925b6
Implement DocumentView.
2011-02-28 18:28:16 +01:00
Jonathan Puckey
a7429205ed
Allow Matrix#applyToContext to optionally reset the matrix transformation.
2011-02-28 18:27:57 +01:00
Jonathan Puckey
12859d7a24
Item: pass on param object to Item#draw.
2011-02-28 16:41:24 +01:00
Jonathan Puckey
c6d606db0a
Path: After calling Path#add(segment), return the added segment. Add todo to Path#insert.
2011-02-27 15:50:41 +01:00
Jonathan Puckey
9496ac70bd
Clean up Path.RegularPolygon constructor.
2011-02-26 19:21:52 +01:00
Jonathan Puckey
eebe7e2731
Implement Path.RegularPolygon constructor and add tests for it.
2011-02-26 19:19:02 +01:00
Jürg Lehni
506e7c036c
Merge remote-tracking branch 'origin/master'
2011-02-26 17:27:12 +01:00
Jürg Lehni
b1b923ab27
Add comment about problems with Base.clone().
2011-02-26 17:27:07 +01:00
Jürg Lehni
6d25dbbd22
Add beginning of path length calculations, work in progress.
2011-02-26 17:26:54 +01:00
Jonathan Puckey
461aa87211
Group: add todo.
2011-02-26 15:55:58 +01:00
Jonathan Puckey
9e6fd5a7e7
Speed up CanvasProvider.
2011-02-26 15:29:51 +01:00
Jonathan Puckey
1a6c5c8c6f
Doc: Change comment about using canvas.width = canvas.width instead of context.clearRect.
2011-02-26 14:38:50 +01:00
Jonathan Puckey
422b8911b8
Fix PlacedSymbol#transformContent.
2011-02-26 13:33:13 +01:00
Jonathan Puckey
22bccf3a31
Tool: Fix issue with onMouseMove being called while the user is dragging the mouse.
2011-02-26 13:00:55 +01:00
Jonathan Puckey
51f4ee718c
As in Scriptographer, we don't worry if there wasn't a moveTo before the first lineTo.
2011-02-26 12:44:09 +01:00
Jonathan Puckey
71bf8dba88
Item: remove logging statement.
2011-02-26 02:04:18 +01:00
Jonathan Puckey
8828ed7e25
CompoundPath - check for this.blendMode != 'normal'.
2011-02-26 01:02:17 +01:00
Jonathan Puckey
bebc8bc8cc
Another attempt at fixing Item#transformContent. The bounds are correctly calculated now, but Item#rotate rotates the items in the wrong direction and rotating by a point doesn't work well.
2011-02-26 00:58:54 +01:00
Jonathan Puckey
f79e6a0454
PlacedSymbol & Raster: fix transformContent and support BlendMode.
2011-02-25 19:38:55 +01:00
Jonathan Puckey
049504a67a
Changed BlendMode library from code ported from Pixastic to code ported from Gavin Kistner's Context Blender Javascript Library.
2011-02-25 18:37:46 +01:00
Jonathan Puckey
c47a18ea58
BlendMode: add todo about using Item#strokeBounds instead of Item#bounds.
2011-02-25 13:57:01 +01:00
Jonathan Puckey
1c364601b4
Added todo about supporting BlendMode for PlacedSymbols.
2011-02-25 13:28:35 +01:00
Jonathan Puckey
ec0b1dec1d
PlacedSymbol: add missing param object to PlacedSymbol#definition#draw call.
2011-02-25 13:13:46 +01:00
Jonathan Puckey
c9d04d33f8
Implement BlendMode class.
2011-02-25 12:47:52 +01:00
Jonathan Puckey
d9b75a7232
Implement Item#reverseChildren() and add tests for it.
2011-02-24 19:31:07 +01:00
Jonathan Puckey
d77741db4f
Implement item#rasterize(resolution).
2011-02-24 19:22:19 +01:00
Jonathan Puckey
014d1053a7
Fix Item#isDescendant / Item#isAncestor, implement Item#isGroupedWith and add tests.
2011-02-24 18:09:48 +01:00
Jonathan Puckey
6cea290dd8
Item: add todo's for missing functionalities.
2011-02-24 17:42:32 +01:00
Jonathan Puckey
4d83631230
Segment: remove todo.
2011-02-24 17:14:59 +01:00
Jonathan Puckey
f65625b591
Change CompoundPath#moveBy to be relative to the previous position in lack of an argument.
2011-02-24 17:13:41 +01:00
Jonathan Puckey
ad82be1bec
Add CompoundPath#bounds
2011-02-24 17:11:02 +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
d37a794b64
Simplify Raster#initialize, set _size in Raster#setCanvas and add todo.
2011-02-24 14:15:30 +01:00
Jonathan Puckey
ff2ac484da
Raster: add todo and perform small cleanup.
2011-02-24 13:56:27 +01:00
Jonathan Puckey
d564be8a7e
Implement new Raster(canvas) / Raster#getSubImage / Raster.drawImage / Raster.ppi.
2011-02-24 13:52:27 +01:00
Jonathan Puckey
f88fcd3049
Implement Point#transform(matrix).
2011-02-24 13:48:24 +01:00
Jonathan Puckey
73df06150a
Fix RGBColor#setGray.
2011-02-24 12:58:16 +01:00
Jonathan Puckey
2712bd0419
Fix mistake in Raster.
2011-02-24 02:39:33 +01:00
Jonathan Puckey
41f3f47dd3
Fix small mistakes in Raster.
2011-02-24 01:51:49 +01:00
Jonathan Puckey
83b8a3e815
Optimize CanvasProvider to only expect a Size object.
2011-02-24 01:36:38 +01:00
Jonathan Puckey
c929bacde8
Clean up Group#draw and save/restore context state when drawing group with opacity.
2011-02-24 01:33:36 +01:00
Jonathan Puckey
dc51384a1a
Allow CanvasProvider to receive sizes too.
2011-02-24 01:29:51 +01:00
Jonathan Puckey
f1cd24eef8
More work on Raster, including getAverageColor, get/setPixel, get/setSize.
2011-02-24 01:28:11 +01:00
Jürg Lehni
0d53167926
Simplify calculation of bezier polynomial derivative, by dividing all factors by 3.
2011-02-22 10:39:05 +01:00
Jürg Lehni
614f9998de
More optimisations in Path#getBounds().
2011-02-22 10:35:48 +01:00
Jürg Lehni
a08e3dc366
Optimise Path#getBounds() by merging internal f() and bounds() functions and thus reducing calls.
2011-02-22 10:33:46 +01:00
Jürg Lehni
452b1e2792
Add explanations to Path#getBounds().
2011-02-22 10:25:18 +01:00
Jürg Lehni
e1bcd70059
Simplify Raster#draw().
2011-02-22 02:27:40 +01:00
Jonathan Puckey
689ddf7555
Raster: implement getPixel and create beans for Raster#canvas and Raster#context that create a canvas object / context when called for the first time.
2011-02-21 19:52:41 +01:00
Jonathan Puckey
cd5b2a7198
PlacedSymbol/ Raster: Use Matrix#applyToContext in draw functions. Also clean up Raster a bit.
2011-02-21 19:04:51 +01:00
Jonathan Puckey
5a786c300b
Implement Matrix#applyToContext.
2011-02-21 19:03:57 +01:00
Jonathan Puckey
53b0f8a329
Update comments about implementing getAverageColor(path).
2011-02-21 18:49:44 +01:00
Jonathan Puckey
9324b9918d
Implement part of Raster.js
2011-02-21 18:43:56 +01:00
Jonathan Puckey
d0c2c5dd1d
Add todo about speeding up canvas clearing.
2011-02-21 03:52:28 +01:00
Jonathan Puckey
b9d37e1b9b
Only draw a CompoundPath if it is visible.
2011-02-21 03:52:03 +01:00
Jonathan Puckey
357a8af6ec
Clean up white spaces.
2011-02-21 03:32:39 +01:00
Jonathan Puckey
4c84379b5b
Remove unused variable.
2011-02-21 03:26:46 +01:00
Jonathan Puckey
514fe1f0e6
Implement group opacity by drawing onto a second canvas first.
2011-02-21 03:22:42 +01:00
Jonathan Puckey
6fcdb86e1c
Implement CanvasProvider that provides reusable canvas elements.
2011-02-21 03:17:09 +01:00
Jonathan Puckey
3cd680c5f0
Merge remote branch 'origin/master'
2011-02-21 01:17:26 +01:00
Jonathan Puckey
5e271359b9
Add todo.
2011-02-21 01:16:53 +01:00
Jürg Lehni
77f1e22727
Merge remote-tracking branch 'origin/master'
2011-02-21 00:28:48 +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
Jonathan Puckey
14943f428f
Remove logging statement.
2011-02-21 00:27:02 +01:00
Jonathan Puckey
5dcf416a7a
Merge remote branch 'origin/master'
2011-02-21 00:26:03 +01:00
Jonathan Puckey
0458e3d916
Check for null in Color#read.
2011-02-21 00:25:45 +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
Jonathan Puckey
245c1e9b90
Merge remote branch 'origin/master'
2011-02-20 23:51:56 +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
Jonathan Puckey
4c4b8246ee
Make sure the whole canvas is cleared.
2011-02-20 23:31:33 +01:00
Jonathan Puckey
51ab66b0f8
Remove trailing comma in ToolEvent.
2011-02-20 21:22:31 +01:00
Jonathan Puckey
f83309d6b7
Optimize Path#draw.
2011-02-20 20:47:13 +01:00
Jonathan Puckey
cb40d3f6f4
Implement Symbol and PlacedSymbol. Add Document#symbols array.
2011-02-20 18:34:38 +01:00
Jürg Lehni
3374e50def
Yet another optimisation in Path#transformContent(): Only transform handles if they are not [0, 0].
2011-02-20 11:20:23 +01:00
Jürg Lehni
98837cbe98
Further optimise Path#transformContent() by reusing arrays and thus reducing memory footprint.
2011-02-20 11:15:40 +01:00
Jürg Lehni
c89d04dca6
Optimise Path#getBounds() by not relying on Point#add() but instead doing the calculations in direct math in the per-coordinate loop.
2011-02-20 02:05:40 +01:00
Jürg Lehni
6c4121db4b
Optimise Path#transformContent() by using Matrix#transform() version that handles arrays of multiple point values for much improved performance.
2011-02-20 01:55:43 +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
Jonathan Puckey
c0a93a8b66
Setters already handle point conversion.
2011-02-19 22:52:00 +01:00
Jonathan Puckey
10623ddb62
Implement Gradient, GradientColor, GradientStop.
2011-02-19 22:50:37 +01:00
Jonathan Puckey
95fa61f1ba
Group: remove unneeded ctx commands.
2011-02-19 18:10:26 +01:00
Jonathan Puckey
a1bec86333
Have Layer extend Group.
2011-02-19 18:09:14 +01:00
Jonathan Puckey
57b7b364bc
Nullify cssString cache when color/alpha values change.
2011-02-19 18:01:08 +01:00
Jonathan Puckey
2b1dee1bd4
Add opacity support in Path#draw.
2011-02-19 17:33:23 +01:00
Jonathan Puckey
c2849b3692
Change PathStyle, CompoundPath and Path to work with new Color classes.
2011-02-19 17:25:16 +01:00
Jonathan Puckey
c386f38b86
GrayColor: fix comment.
2011-02-19 17:22:20 +01:00
Jonathan Puckey
068c4dc1ca
Add missing Color.js.
2011-02-19 17:10:26 +01:00
Jonathan Puckey
b944b82abe
GrayColor: fix comments.
2011-02-19 17:08:08 +01:00
Jonathan Puckey
66105dd4ac
Implement Color, RGBColor & GrayColor.
2011-02-19 17:05:39 +01:00
Jonathan Puckey
bd5c906047
Fix error in CompoundPath.
2011-02-19 14:12:05 +01:00
Jonathan Puckey
8af671bb41
Merge remote branch 'origin/master'
2011-02-19 14:07:26 +01:00
Jürg Lehni
451eaaa3c6
Add a TODO comment.
2011-02-19 13:07:24 +01:00
Jürg Lehni
6093151a3b
Make sure that setting styles explicitely to null works.
2011-02-18 08:04:20 +00:00
Jürg Lehni
d02b5cd56a
Yet another optimisation, by using the Base.each() sidecar (bind object) to fill Item fields, and inject it straight away upon returning from it.
2011-02-18 07:58:59 +00:00
Jürg Lehni
31b595fa9e
Rename itemProps to itemFields, for more consistency.
2011-02-17 23:47:04 +00:00
Jürg Lehni
2c06ec965c
Simplify PathStyle further, by removing the _get/_setChildrenStyle methods and moving their functionality into the closure injection code.
2011-02-17 23:37:21 +00:00
Jürg Lehni
4e05faaa11
Use the same simplifications in PathStyle as in CompoundPath, and rely on Base.each as well to provide the scope for closure injection.
2011-02-17 23:34:45 +00:00
Jürg Lehni
b14c9ae21b
For the closure injection to work properly we need an iterator function that provides a scope to the referenced key value. Rely on Base.each() for this, which even in a scaled down Bootstrap will be available and not harmful, as it won't rely on modified native prototypes.
2011-02-17 23:34:03 +00:00
Jürg Lehni
bc33ae8084
Add missing #closePath() to both Path and CompoundPath.
2011-02-17 23:01:18 +00:00
Jürg Lehni
4c2e1ee5c9
Optimise and simplfy CompoundPath code, by moving scope into extend() call, and only compiling one fields object inside it that is return at the end.
2011-02-17 22:58:56 +00:00
Jürg Lehni
e6dc189310
Simplify injection separation by using multiple arguments to extend().
2011-02-17 22:46:28 +00:00
Jürg Lehni
5850ef3cfc
Seperate Path definition into two parts, one that requires scoped private functions and values, and one that does not, to keep related things closer together and save indentation space.
2011-02-17 20:08:37 +00:00
Jürg Lehni
19121c33b2
Simplify injection of Path constructors.
2011-02-17 20:04:02 +00:00
Jonathan Puckey
637e85b31b
Group: fix clipping.
2011-02-17 16:50:06 +01:00
Jonathan Puckey
2a1e00d127
Group: Implement clipping support.
2011-02-17 16:37:29 +01:00
Jonathan Puckey
deb1699f13
Tidy up code.
2011-02-17 16:00:03 +01:00
Jonathan Puckey
36de01a6ae
Move Path Constructors into seperate file.
2011-02-17 15:55:26 +01:00
Jonathan Puckey
1953c17f41
CompoundPath: move getCurrentPath into the outer scope and implement smooth and simplify.
2011-02-17 14:33:25 +01:00
Jonathan Puckey
0c1f29ce29
Implement CompoundPath and move most of PathItem into Path.
2011-02-17 13:36:40 +01:00
Jonathan Puckey
7e404703c8
Add Group#getBounds().
2011-02-17 00:34:01 +01:00
Jonathan Puckey
3ae20c8a4b
Item: undo mistaken changes to transform comments.
2011-02-16 22:35:53 +01:00
Jonathan Puckey
13b8ddccc8
PathStyle: small cleanup.
2011-02-16 22:15:19 +01:00
Jonathan Puckey
4000853c2f
Implement PathStyle and Document#currentStyle.
2011-02-16 22:09:51 +01:00
Jonathan Puckey
9adb668d2a
Group: add missing beans property.
2011-02-16 22:06:24 +01:00
Jonathan Puckey
3e2b4adc27
Layer: implement moveAbove / moveBelow / nextSibling / previousSibling
2011-02-16 18:55:12 +01:00
Jürg Lehni
8a0a0712cd
Add Layer#index to override Item#index.
2011-02-16 00:18:58 +00: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
b8816a07f5
Reformat to fit 80 chars boundary.
2011-02-15 23:10:48 +00:00
Jürg Lehni
9a9005a604
Correct comments about transform flags.
2011-02-15 22:57:12 +00:00
Jürg Lehni
3d64b017c5
Remove comment about having Point.read() return consumed arguments indices, as after analysing the situation it seem too complex to imeplement easly: Point.read internally relies on Point#initialize for all the heavy lifting, and this would have to report back how many indices were consumed somehow...
2011-02-15 22:56:53 +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
c6b5b11b1e
Use dragstart event instead of mousedown, to go with drag and dragend.
2011-02-15 22:32:05 +00:00
Jonathan Puckey
2b626be502
Item: use internal _clipMask variable, so we don't collide with getters/setters.
2011-02-15 12:05:39 +01:00
Jonathan Puckey
24e93bcaf5
Tool#setDocument: remove mousemove functionality for now, since it is interfering with tool.fixedDistance.
...
Remove events when a tool has been attached to another document before.
When not passed a document in the constructor, use the global Paper.document.
Only redraw the document when the corresponding mousehandler exists.
2011-02-15 00:01:56 +01:00
Jonathan Puckey
3c22aedfbb
ToolEvent: fix small mistake.
2011-02-14 23:41:47 +01:00
Jonathan Puckey
30fef4d147
Group: use internal _clipped variable, so we don't collide with getters/setters.
2011-02-14 22:51:31 +01:00
Jonathan Puckey
4395caf41f
Tool: add support for Tool#onMouseMove(event) and add RoundedRectangles example
2011-02-14 22:43:14 +01:00
Jonathan Puckey
e36ea0c2e3
Tool: add support for Tool#eventInterval
2011-02-14 22:23:05 +01:00
Jonathan Puckey
a633b2a066
Tool: use dragend instead of mouseup, since mouseup is not fired when the mouse is released outside of the canvas area.
2011-02-14 20:08:19 +01:00
Jürg Lehni
a154819350
Switch to using indexOf() in Segment#index for now.
2011-02-14 10:35:40 +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
91e8a3b652
Update Bootstrap to fix issues with beans (requiring definition of setter when getter is redefined in sub-class), and remove setBounds in PathItem that was introduced for that reason.
2011-02-14 10:28:27 +00:00
Jürg Lehni
a6e9ee56d4
Cleanup Path constructors by using simple constructor functions instead of Base.extend() classes, use Path.Oval for Path.Circle and optimise Path.Oval through ovalSegments array with real segments (no use to call Segment.read each time).
2011-02-14 02:05:54 +00:00
Jürg Lehni
12d82ece56
Define beans in Matrix.
2011-02-14 01:52:53 +00:00
Jürg Lehni
ed55dc39fb
Fix PathItem constructor by no redefining arguments variable that results in arguments array changing as well on some browsers.
2011-02-14 01:47:56 +00:00
Jürg Lehni
38f4dd353d
Make Item#bounds setter work for PathItem, and add two TODO comments about Bootstrap shortcommings that cause it to break.
2011-02-14 01:24:22 +00:00
Jürg Lehni
87f146fb44
Have Item#setPosition use Point.read() for point conversion.
2011-02-14 01:17:43 +00:00
Jürg Lehni
50f285798c
Fix Item#setPosition and Item#setBounds to actually work (unfinished porting work).
2011-02-14 01:14:43 +00:00
Jürg Lehni
3af5d549f6
Add comments about possible optimisations in PathItem#transformContent().
2011-02-14 01:14:03 +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
420ffaa7ea
No need to check for existance of handleIn/Out, as they are always defined.
2011-02-13 18:56:06 +00:00
Jürg Lehni
7370326cb2
Add space after beans: true.
2011-02-13 18:52:17 +00:00
Jürg Lehni
604ff7824c
Add comment about ideally not relying on parent.children.indexOf for getIndex().
2011-02-13 18:51:49 +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
Jürg Lehni
d67055b09b
Add documentation to PathItem#bounds.
2011-02-13 15:59:22 +00:00
Jürg Lehni
515439c4df
Optimize PathItem#bounds by using less coordinate lookups.
2011-02-13 15:55:43 +00:00
Jürg Lehni
71d1ff3cb3
Make PathItem#getBounds() work for closed paths too.
2011-02-13 15:51:54 +00:00
Jürg Lehni
d59d514a55
Fix bug in PathItem#bounds (wrongly used variable name twice), now works properly for open paths.
2011-02-13 15:49:36 +00:00
Jürg Lehni
e08359f49d
Beginning of PathItem#bounds and tests to go along with it, not functional yet.
2011-02-13 15:40:30 +00:00
Jürg Lehni
a30e4057e3
Fix PathItem constructor to support passing of segments both as array and arguments.
2011-02-13 15:39:24 +00:00
Jürg Lehni
771d9d0efe
Fix a couple of bugs in shape drawing code, and switch to consistently use this.currentSegment rather than this._segments[this._segments.length - 1], to use the internal check for a starting point.
2011-02-13 15:12:25 +00:00
Jürg Lehni
a579b8bd3d
Make sure Segment#handleIn and #handleOut are always defined, even when not provided, and change compareSegments() to also reflect this change by relying on Segment.read for conversion of comparison values.
2011-02-13 15:09:24 +00:00
Jürg Lehni
4b2341b3c2
Add gettter/setters for Path#segments, and fix bug in Segment#previous.
2011-02-13 13:52:51 +00:00
Jonathan Puckey
e2c77a866d
Nullify path parent when removed.
2011-02-12 19:45:11 +01:00
Jonathan Puckey
7fdf439ef2
Group: allow passing of array of items to constructor and pass on ctx in draw function. Add tests for Group.
2011-02-12 19:12:23 +01:00
Jonathan Puckey
c1d2cab5d9
Segment.js: fix toString and remove methods. Add test for segment.remove().
2011-02-12 19:10:19 +01:00
Jonathan Puckey
9b5e18c795
PathItem: replace this.segments.push(segment) to this.addSegment(segment)
2011-02-12 19:08:34 +01:00
Jonathan Puckey
c0e2101c32
Clean up src directory and move Bootstrap.js into lib.
2011-02-12 17:59:39 +01:00
Jonathan Puckey
67f2b146b0
Implement Path#copyTo(itemOrDocument) and Path#clone()
2011-02-12 17:43:51 +01:00
Jonathan Puckey
38ada4abc1
Improve Item#isDescendant(item) and introduce Item#isAncestor(item).
2011-02-12 16:41:57 +01:00
Jonathan Puckey
e9e987f304
Fix Item#isDescendant(item).
2011-02-12 16:36:48 +01:00
Jonathan Puckey
d7fc9cf481
Introduce Paper object that keeps track of documents and which documenti is active. Newly created items are automatically appended to the children list of the active document's activeLayer.
2011-02-12 16:20:10 +01:00
Jonathan Puckey
62409a18d4
Layer.js: pass on ctx in draw function
2011-02-11 18:49:04 +01:00
Jonathan Puckey
d85217c40d
Fix small error in Doc.js
2011-02-11 18:46:49 +01:00
Jonathan Puckey
31c51ea9eb
Add a layer to the document's children list when created and support activeLayer.
2011-02-11 18:38:44 +01:00
Jonathan Puckey
c9c27f7be2
Initial support for Layer and Group
2011-02-11 18:37:36 +01:00
Jonathan Puckey
d63cac7561
Implement more of Item
2011-02-11 18:36:03 +01:00
Jonathan Puckey
34b9258e8e
Have PathItem constructor call this.base() and don't draw item when it is hidden
2011-02-11 18:30:48 +01:00
Jonathan Puckey
b47e896389
Implement Bootstrap.js changes:
...
Fix Firefox support for beans through __defineGetter/Setter__.
Fix redefinition of properties on Safari through call to delete first.
2011-02-11 18:08:35 +01:00
Jonathan Puckey
0221dd7fb7
Have predefined shape constructors use bean properties
2011-02-11 14:41:32 +01:00
Jonathan Puckey
0f21520800
Implement getters and setters
2011-02-11 14:40:36 +01:00
Jonathan Puckey
59a4c1183b
Switch Bootstrap.js version to one with beans support
2011-02-11 14:20:34 +01:00
Jonathan Puckey
e234b3735c
Have the predefined shape constructors return a path instead of inheriting from it
2011-02-11 11:49:24 +01:00
Jonathan Puckey
0d1f0bf5a1
Add insert function for PathItem
2011-02-09 01:12:03 +01:00
Jonathan Puckey
440db1c1e3
Remove try/catch clauses and add missing check for existance of onMouseUp
2011-02-09 01:07:29 +01:00
Jonathan Puckey
7e285abe7a
Add initial support for mouse events.
2011-02-08 13:15:55 +01:00
Jonathan Puckey
cb5a8aa2fc
Rename Doc#draw to Doc#redraw
2011-02-08 13:15:27 +01:00
Jonathan Puckey
cbb10922c5
Include the full Bootstrap library for now to support mouse events.
2011-02-08 13:14:52 +01:00
Jonathan Puckey
5a309f67dc
Remove SegmentList.js for now.
2011-02-07 19:53:27 +01:00
Jonathan Puckey
b19ba2014c
Initial commit
2011-02-07 19:28:09 +01:00