Commit graph

862 commits

Author SHA1 Message Date
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