Commit graph

1192 commits

Author SHA1 Message Date
Jürg Lehni
8a449b0e76 Remove deprecated Item#appendChild(). 2011-05-16 20:14:49 +01:00
Jürg Lehni
f12ed7234a Shorten code. 2011-05-16 19:44:46 +01:00
Jürg Lehni
97c4435d87 Fix typo. 2011-05-16 19:35:42 +01:00
Jürg Lehni
d535a1f6fc Clean up method sequence in Item. 2011-05-16 19:35:09 +01:00
Jürg Lehni
75b0fa3596 Add Item#removeChildren() and #setChildren(). 2011-05-16 19:34:57 +01:00
Jürg Lehni
c4203fe174 Change the way associated PathStyles are created and updated. 2011-05-16 19:21:36 +01:00
Jürg Lehni
05c0eb0e51 Simplify PathStyle#initialize(). 2011-05-16 19:20:32 +01:00
Jürg Lehni
34110fa82d Move #_setStyle() closer to the related styles hash. 2011-05-16 19:19:18 +01:00
Jürg Lehni
c8c47bf641 get styles directly from _style object rather than passing through getters on Item. 2011-05-16 18:57:47 +01:00
Jürg Lehni
da670b4171 Improve comments. 2011-05-16 18:29:53 +01:00
Jürg Lehni
8b2da34483 Remove reference to inexisting Request.js file. 2011-05-16 16:57:52 +01:00
Jonathan Puckey
4ebb6985d6 CharacterStyle: Use 'sans-serif' as default font. 2011-05-16 15:58:10 +02:00
Jonathan Puckey
6dbecffd85 Merge remote branch 'origin/master' 2011-05-16 15:46:35 +02:00
Jonathan Puckey
2be70ae73f Gradient#setStops: improve checking for array. 2011-05-16 15:46:25 +02:00
Jürg Lehni
b65ec49207 Merge remote-tracking branch 'origin/master' 2011-05-16 14:26:48 +01:00
Jürg Lehni
c30565fb7b Remove files forgotten in recent renaming. 2011-05-16 14:26:16 +01:00
Jonathan Puckey
979ab18e9a Implement basic version of TextItem, PointText, CharacterStyle & ParagraphStyle. 2011-05-16 15:15:47 +02:00
Jonathan Puckey
4ad47ed3aa Fix accidental internal bean access to #fillColor and #strokeColor in Path#_transform. 2011-05-16 15:11:13 +02:00
Jürg Lehni
cfe968d30e Rename Document -> Project, DocumentView -> ProjectView, paper.document -> paper.project and paper.documents -> paper.projects, to avoid name clashing with window.document. 2011-05-16 13:33:15 +01:00
Jürg Lehni
edd36e7df8 Remove Document#bounds and #size, since this will be on Page. 2011-05-16 13:10:18 +01:00
Jürg Lehni
fa0b664312 Fix error in mousedown handler when using eventInterval. 2011-05-16 13:08:22 +01:00
Jürg Lehni
a19f2020fb Use that instead of this, since we're in an unbound callback. 2011-05-16 13:06:26 +01:00
Jürg Lehni
1747118ed4 Have onResize() call onFrame() if it's defined. 2011-05-16 13:03:02 +01:00
Jürg Lehni
0504b99af8 Redraw DocumentView in #setViewBounds(). 2011-05-16 12:45:49 +01:00
Jürg Lehni
671d790068 Fix bug caused by recent commit. 2011-05-16 12:43:51 +01:00
Jürg Lehni
6051fe3fda Add / fix DocumentView#viewBounds, #center, #bounds, #size. 2011-05-16 12:37:02 +01:00
Jürg Lehni
6e4334ee29 Fix Size#toString(). 2011-05-16 12:36:17 +01:00
Jürg Lehni
f545805786 Move Rectangle#transformCornerCoordinates() to Matrix#_transformCorners(). 2011-05-16 12:29:52 +01:00
Jürg Lehni
fc547793fa Remove redundant Rectangle#transformBounds() and merge its code with less optimised Matrix#transformBounds(). 2011-05-16 12:25:18 +01:00
Jürg Lehni
aaceeb4f54 Add Rectangle#transformBounds(). 2011-05-16 11:32:33 +01:00
Jürg Lehni
fc776f03eb Add Rectangle#transformCornerCoordinates() and use it in Item.drawSelectedBounds(). 2011-05-16 11:25:39 +01:00
Jürg Lehni
9f34042bae Fix comment. 2011-05-16 11:19:47 +01:00
Jürg Lehni
42e7fc910f Simplify GradientColor#transform(), using new _transformPoint() parameters. 2011-05-16 11:19:40 +01:00
Jürg Lehni
f0b29e0e4d Make Item#position a LinkedPoint and change the way it's transformed in #transform(). 2011-05-16 11:19:19 +01:00
Jürg Lehni
f92434ab54 Add dontNotify parameter to _transformPoint(), required sometimes for LinkedPoints. 2011-05-16 11:18:53 +01:00
Jürg Lehni
9384fb4fb5 Add an optinonal dest parameter to Matrix#_transformPoint(). 2011-05-16 11:07:39 +01:00
Jürg Lehni
71bf4fdbca Two forms of scoping are required when evaluating PaperScripts: with(){} and a function scope, so local vars are not trying to override properties on the scope through with(){} (e.g. var view = ...). 2011-05-16 11:00:33 +01:00
Jürg Lehni
2773ef693a Add PaperScope#view and #layer as shortcuts to #document.activeView / activeLayer. 2011-05-16 10:59:45 +01:00
Jürg Lehni
a601cfdd6d Clear the indices and path references of the removed segments. 2011-05-16 01:37:31 +01:00
Jürg Lehni
98a59a3011 Rename PaperScript#run() to #evaluate() and add it to PaperScope too. 2011-05-16 01:22:06 +01:00
Jürg Lehni
c403dccea3 Expose capability to run PaperScripts from script tags. 2011-05-16 00:57:13 +01:00
Jürg Lehni
30e3359d1d Split PaperScope#remove() into #clear() and #remove(), so scopes can be reused. 2011-05-16 00:56:47 +01:00
Jürg Lehni
593813660a Associate PaperScope objects with the script tag that produced them through an assigned unique id. 2011-05-16 00:29:29 +01:00
Jürg Lehni
78a9f9afe9 Let Keyboard handlers know which view should receive keyboard focus. 2011-05-16 00:17:37 +01:00
Jürg Lehni
3e71278b78 Make sure the frame handler stops when a view is removed. 2011-05-16 00:05:11 +01:00
Jürg Lehni
abcba7deb4 Remove all views in Document#remove(). 2011-05-16 00:05:03 +01:00
Jürg Lehni
3a15360efc Rename ChangeFlags.PATH to GEOMETRY. 2011-05-16 00:01:06 +01:00
Jürg Lehni
690a79722f Add alternative code for setting handler on tool that does not rely on eval(), commented out for now. 2011-05-15 23:56:41 +01:00
Jürg Lehni
5bc2889f1c Add documentation and remove dontSwitch parameter, since it will also receive the time as defined for requestAnimationFrame() callback. 2011-05-15 23:50:53 +01:00
Jürg Lehni
535e5fc5fc Add support for onResize handler. 2011-05-15 23:46:34 +01:00
Jürg Lehni
3bd4db802c Simplify onFrame handling. 2011-05-15 23:41:24 +01:00
Jürg Lehni
c1dc823706 Move onFrame handler to DocumentView. 2011-05-15 23:37:40 +01:00
Jürg Lehni
f69b0a404a Remove unused #document from Tool. 2011-05-15 22:45:15 +01:00
Jürg Lehni
824870196e Clean up mouseup handler. 2011-05-15 22:43:30 +01:00
Jürg Lehni
83373576f2 Fix various refactoring errors. 2011-05-15 22:41:56 +01:00
Jürg Lehni
e8033730c8 Move event handling from Tool to DocumentView. 2011-05-15 22:25:46 +01:00
Jürg Lehni
f0e8c54008 Step one of transition to proper separation of view and document, regarding canvas drawing, mouse interaction, resizing, frame handling, etc. Work in progress. 2011-05-15 21:56:43 +01:00
Jürg Lehni
0dc2241a9c No need to set _index to null since Base.splice() handles that for us. 2011-05-15 21:42:31 +01:00
Jürg Lehni
9c97e44207 Have Base.splice() delete the indices of removed items. 2011-05-15 21:37:01 +01:00
Jürg Lehni
31be916c4f Add dontModify parameter to #set() method in Linked* classes, and rename #_set to #_setter. 2011-05-15 20:34:22 +01:00
Jürg Lehni
a2dc2c7dd8 Fix comment. 2011-05-15 20:27:12 +01:00
Jürg Lehni
818c847d73 Add LinkedSize and use it in Rectangle#getSize(). 2011-05-15 20:26:56 +01:00
Jürg Lehni
10d56f318f Add Size#isZero(). 2011-05-15 20:26:37 +01:00
Jürg Lehni
638d768406 Move Point#equals() to other test methods. 2011-05-15 20:26:20 +01:00
Jürg Lehni
217a2e6ecb Remove dirty rectangle test code for now. 2011-05-15 20:09:50 +01:00
Jürg Lehni
ef0347a6bc Fix accidental internal bean access to #segments. 2011-05-15 19:58:29 +01:00
Jürg Lehni
ebdf5a2dfd Shorten CompoundPath#moveBy(). 2011-05-15 19:58:09 +01:00
Jürg Lehni
54161f81f1 Add expected parameters to function signature. 2011-05-15 19:57:48 +01:00
Jürg Lehni
c4c4f51eb9 Shorten getCurrentPath(). 2011-05-15 19:31:25 +01:00
Jürg Lehni
7ba2fcad2a Allow passing of Paths to CompoundPath constructor as arguments, without an array object. 2011-05-15 19:14:09 +01:00
Jürg Lehni
0fd8c4e046 Fix CompoundPath test and add it to load.js so it actually gets tested. 2011-05-15 19:09:34 +01:00
Jürg Lehni
c9d0f982c2 Don't set _clockwise in Path#isClockwise(), as it should only be set once the use explicitely does so. 2011-05-15 19:02:50 +01:00
Jürg Lehni
d12608c708 Minor clean ups. 2011-05-15 18:53:09 +01:00
Jonathan Puckey
a9fbc41e15 Clean up Item#name code. 2011-05-15 19:27:32 +02:00
Jürg Lehni
1b58719202 Merge remote-tracking branch 'origin/master' 2011-05-15 18:13:00 +01:00
Jonathan Puckey
a90aa09bd7 Merge remote branch 'origin/master' 2011-05-15 19:12:38 +02:00
Jonathan Puckey
d998cd30f3 Add support for accessing items by name through their parent's children list. 2011-05-15 19:12:27 +02:00
Jürg Lehni
36c9286ca9 Add #count to onFrame() event. 2011-05-15 18:08:41 +01:00
Jürg Lehni
4cee442a05 Rename items parameter to paths. 2011-05-15 18:05:47 +01:00
Jürg Lehni
3d76034600 Use Path#setClockwise() in CompoundPath constructor to reverse top path so that the others appear as holes cut out from it. 2011-05-15 18:05:00 +01:00
Jürg Lehni
813b70c70b Update comment a bit to make code more clear. 2011-05-15 17:59:57 +01:00
Jürg Lehni
6e0e31480a Remove recently introduced code blocks for small conditional statements. 2011-05-15 17:59:37 +01:00
Jürg Lehni
40c988b313 Add Path#is/setClockwise(), as a way to check and define a path's orientation. 2011-05-15 17:59:06 +01:00
Jürg Lehni
6fc418b581 Fix accidentally reversed change and clean up code a bit. 2011-05-15 15:12:59 +01:00
Jürg Lehni
252a3635dc Replace {@true} tags in documentation ({@true ([^}]*)} -> true $1, false otherwise.) 2011-05-15 15:06:10 +01:00
Jürg Lehni
ee8b66e19a Remove methods / fields that are hidden on Scriptographer through @jshide. 2011-05-15 15:03:33 +01:00
Jürg Lehni
2c078d8b17 Remove all code blocks and group titles from documentation since we're relying on Scriptographer code and documentation generation (through javadoc) for docs. 2011-05-15 15:01:59 +01:00
Jürg Lehni
c91cbe2175 Merge remote-tracking branch 'origin/master' 2011-05-15 14:37:34 +01:00
Jürg Lehni
057b71ff4c Don't overuse variable chaining - use only were readibility does not suffer. 2011-05-15 14:29:00 +01:00
Jonathan Puckey
f8f6754068 Fix mistake in earlier commit. 2011-05-15 14:26:08 +02:00
Jonathan Puckey
3f8f539aeb Fix bugs in Raster#getAverageColor. 2011-05-15 14:13:47 +02:00
Jonathan Puckey
2c36f3a62e Fix bug in Color#read. 2011-05-15 14:11:35 +02:00
Jonathan Puckey
1a82ef4a34 Merge remote branch 'origin/master' 2011-05-15 14:09:57 +02:00
Jürg Lehni
51dbd85db5 Add experimental orientation detection for Paths. 2011-05-15 11:33:09 +01:00
Jürg Lehni
06f16d0c2a Define a unique id for each PaperScript. 2011-05-15 11:32:42 +01:00
Jürg Lehni
3cb78db5f5 Fix typo. 2011-05-15 11:32:09 +01:00
Jürg Lehni
1dd0ee2533 Simplify Item#getId() 2011-05-14 22:38:27 +01:00
Jürg Lehni
0d85e0941c Add inverse matrix caching. 2011-05-14 20:20:10 +01:00
Jürg Lehni
064f3e05d3 Simplify paper scope switching code for now, as key handling code depends on paper object to always point to a valid one. This is a workaround, rethinking of how key handling should be distributed across multiple instances within one page is required. 2011-05-14 20:08:14 +01:00
Jonathan Puckey
fa41328804 Merge remote branch 'origin/master' 2011-05-14 20:37:25 +02:00
Jonathan Puckey
42ae3ce42e CompoundPath#draw: set param.compound to false when done drawing. 2011-05-14 20:36:58 +02:00
Jürg Lehni
df1c5cdcbb Add Document#remove(). 2011-05-14 18:58:41 +01:00
Jürg Lehni
5593eb94d0 Simplify Item#_removeFromParent(). 2011-05-14 18:11:31 +01:00
Jürg Lehni
4e059af684 Reassign Item#_index in #reverseChildren(). 2011-05-14 18:07:45 +01:00
Jürg Lehni
0bab694a01 Rename Item#children to private Item#_children and add #getChildren getter. 2011-05-14 18:07:10 +01:00
Jürg Lehni
185a7f15ac Fix newly introduced error. 2011-05-14 18:00:29 +01:00
Jürg Lehni
897e00fee5 Have Document#activate() use the internal #_index property. 2011-05-14 17:57:59 +01:00
Jürg Lehni
2fa64bb343 Add Document#getIndex(). 2011-05-14 17:57:43 +01:00
Jürg Lehni
df51b25fec Add comment about plain properties that need to send _changed() notifications. 2011-05-14 17:57:23 +01:00
Jürg Lehni
de34f8c157 Clear Item#_index when removing item and simplify #getIndex(). 2011-05-14 17:56:56 +01:00
Jürg Lehni
25c2d68f37 Switch to Item#_parent / #getParent() as property is read-only. 2011-05-14 17:56:14 +01:00
Jürg Lehni
37e4c654d3 Use Date.now() as all supported browsers have it. 2011-05-14 17:23:17 +01:00
Jürg Lehni
f6f307822a Fix comment. 2011-05-14 17:23:00 +01:00
Jürg Lehni
01fdeb270b Move PaperScript.js to core. 2011-05-14 17:22:49 +01:00
Jürg Lehni
53293ab8bd Merge remote-tracking branch 'origin/master' 2011-05-14 16:00:47 +01:00
Jürg Lehni
0356fdb3b6 Add PaperScope switching to onFrame handler. 2011-05-14 16:00:30 +01:00
Jürg Lehni
8375a97d55 Scope setting / restoring can be simplified since it should never be nested. 2011-05-14 15:59:19 +01:00
Jonathan Puckey
2de41253c2 Fix bug where document wasn't being redrawn after onMouseDrag events. 2011-05-14 16:58:37 +02:00
Jürg Lehni
c89fcdcb2e Merge remote-tracking branch 'origin/master'
Conflicts:
	src/tool/Tool.js
2011-05-14 15:27:56 +01:00
Jürg Lehni
518803f492 Add support for switching PaperScope contexts in PaperScript code exeuction and callback handling. This should add proper support for multiple PaperScript instances in one site. 2011-05-14 14:15:31 +03:00
Jürg Lehni
3072eed91d Clean up ToolHandler code by making many fields private, to better reflect the Java version. 2011-05-14 14:13:48 +03:00
Jonathan Puckey
2bfe42da05 Have the CompoundPath constructor reverse the segments of all paths passed to it except for the first one. Introduce 'keepDirection' option to allow importing of already existing CompoundPath items. 2011-05-14 13:03:18 +02:00
Jonathan Puckey
35d51085a1 Tool: fix problem where document was being redrawn onMouseMove with only an onMouseDrag handler (should only happen on touch devices) 2011-05-14 12:59:21 +02:00
Jürg Lehni
edaaaa4df5 Merge PaperScope injection and creation into one statement. 2011-05-14 13:39:43 +03:00
Jürg Lehni
a1efd85ecb Improve PaperScope definition so it also works when using load.js, and seperate paper.js code into core/Base.js and core/PaperScope.js. 2011-05-14 13:38:45 +03:00
Jürg Lehni
9ef31616d5 Have paper.install() use Base.each(). 2011-05-14 13:14:43 +03:00
Jürg Lehni
d64fe1f179 Improve comments. 2011-05-14 13:12:49 +03:00
Jürg Lehni
91332d465a Switch to using an internal PaperScope class and have the global paper variable simply be a pointer to the currently active one (step one of PaperScope context switching and support of multiple PaperScript instances within one web-site). 2011-05-14 13:10:38 +03:00
Jürg Lehni
3feb45addc Add keepalive attribute to canvas to tag that controls wether it animates in background in emulated requestAnimationFrame() function, and use it in all example files. 2011-05-14 13:04:02 +03:00
Jürg Lehni
a775e66632 Do not use #splice() for the initial push to the documents / children list. 2011-05-14 12:42:52 +03:00
Jürg Lehni
8c2ad5f331 Improve documentating comments. 2011-05-14 12:41:06 +03:00
Jonathan Puckey
032d19b0d2 Fix bug in CompoundPath where toCssString was being called instead of getCanvasStyle, resulting in problems when gradients were used. 2011-05-12 15:30:56 +02:00
Jonathan Puckey
d3e9a1152d Merge remote branch 'origin/master' 2011-05-11 22:46:53 +02:00
Jonathan Puckey
bd932a9242 Implement onFrame event.delta & event.time. 2011-05-11 22:46:08 +02:00
Jürg Lehni
366122cd33 Merge remote-tracking branch 'origin/master' 2011-05-08 21:46:54 +01:00
Jürg Lehni
079008b243 Code clean up. 2011-05-08 21:46:49 +01:00
Jürg Lehni
b44d85277f Fix resizing of invisible canvas elements, by remembering their last offset when they were visible. 2011-05-08 21:46:41 +01:00
Jonathan Puckey
ccf5dd70f6 PaperScript: call the onFrame handler straight away. 2011-05-08 18:44:33 +01:00
Jonathan Puckey
5ddb8e22d3 Merge remote branch 'origin/master' 2011-05-08 17:33:42 +01:00
Jürg Lehni
c44b9b254e Fix error in ToolEvent#delta. 2011-05-08 17:32:59 +01:00
Jonathan Puckey
34077dc901 Item#_getBounds: don't include bounds of hidden items. 2011-05-08 17:17:54 +01:00
Jonathan Puckey
4490403ae9 Undo last commit. 2011-05-08 16:53:59 +01:00
Jonathan Puckey
6cd8241df8 Set default currentStyle of Document to have a black stroke color. 2011-05-08 16:48:41 +01:00
Jürg Lehni
de2bbe844b Use getters rather than beans. 2011-05-08 15:51:01 +01:00
Jürg Lehni
e79d890432 Add #toString() to Event#modifiers. 2011-05-08 15:50:17 +01:00
Jürg Lehni
585e3b6254 Clean up and shorten code. 2011-05-08 15:45:40 +01:00
Jürg Lehni
af8fd22ae2 Remove hyphen from event types, to go with the naming of the browser world more. 2011-05-08 15:35:10 +01:00
Jürg Lehni
04ff593adc Have Events print modifiers correctly in #toString(). 2011-05-08 15:33:00 +01:00
Jürg Lehni
5a9dc3dece Have Event#modifiers exposed as a bean. 2011-05-08 15:28:56 +01:00
Jürg Lehni
6593c07127 Fix more key handling bugs and make Key.isDown() work again. 2011-05-08 15:28:35 +01:00
Jürg Lehni
450fadfcbf Fix issues with keys that fire both keydown and keypress events, such as space. 2011-05-08 15:23:32 +01:00
Jürg Lehni
3afe7ea5bb Merge remote-tracking branch 'origin/master' 2011-05-08 15:16:52 +01:00
Jürg Lehni
742c9da822 More work on key handling and rename KeyEvent#keyCode -> KeyEvent#key. 2011-05-08 15:16:41 +01:00
Jürg Lehni
9f47942e7a Fix typo. 2011-05-08 15:16:18 +01:00
Jonathan Puckey
94889148a4 GradientColor: clone origin / destination & hilite points. 2011-05-08 14:29:58 +01:00
Jürg Lehni
e0e8ee0152 Remove _owner check in Base.read() again. 2011-05-08 14:29:49 +01:00
Jürg Lehni
aac87dba14 Move #toString() to the end. 2011-05-08 14:13:33 +01:00
Jürg Lehni
7034f8241b Remove deprecated onOptions. 2011-05-08 14:09:55 +01:00
Jonathan Puckey
436cbe49a8 Merge remote branch 'origin/master' 2011-05-08 14:06:16 +01:00
Jonathan Puckey
bbccb25184 Transform gradient when path is transformed. 2011-05-08 14:05:47 +01:00
Jürg Lehni
37f982e53f Remove unused lookup table. 2011-05-08 13:46:31 +01:00
Jürg Lehni
b26caee702 Improve key event handling, work in progress. 2011-05-08 13:43:52 +01:00
Jürg Lehni
2f4f003873 Have Base.read() clone owned objects such as SegmentPoint or LinkedPoint. 2011-05-08 13:38:09 +01:00
Jürg Lehni
926fffee4a Rename Event -> DomEvent and Element -> DomElement, to be more specific and not clash with other classes, e.g. a future base class for ToolEvent and KeyEvent. 2011-05-08 10:16:11 +01:00
Jürg Lehni
0e37f86156 Fix porting mistakes. 2011-05-08 10:07:10 +01:00
Jürg Lehni
327515a9de Add missing header. 2011-05-08 09:59:37 +01:00
Jürg Lehni
bb5146397c Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-08 00:54:15 +01:00
Jürg Lehni
4be33a2b3f Update Element bounds, scroll and visibility handling to take nested divs with overflow into account . 2011-05-08 00:54:07 +01:00
Jonathan Puckey
3118d8547d Include HSBColor.js in paper.js. 2011-05-08 00:23:59 +01:00
Jürg Lehni
c053fb977a Export PaperScript object and its load function as paper.load. 2011-05-07 20:50:32 +01:00
Jürg Lehni
081a303de0 Make sure PaperScripts are not loaded more than once by setting the loaded attribute to true on them. 2011-05-07 20:50:12 +01:00
Jonathan Puckey
791d9335ce Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-07 18:18:51 +01:00
Jonathan Puckey
4649835d5b Document: fix selection drawing in Firefox. 2011-05-07 18:18:14 +01:00
Jürg Lehni
20409f3084 Use Base.splice() for Layers too. 2011-05-07 17:27:19 +01:00
Jürg Lehni
566f52201c Fix typo. 2011-05-07 17:11:12 +01:00
Jürg Lehni
70d0dd9c0c Move #moveTo() to the same scope as the other drawing commands, and add explaining comments. 2011-05-07 17:11:06 +01:00
Jürg Lehni
979bda52ab We don't need the empty #initialize(). 2011-05-07 17:05:42 +01:00
Jürg Lehni
d254d9542d Add ChangeFlags.HIERARCHY, for future change notifications when children get rearranged. 2011-05-07 16:52:54 +01:00
Jürg Lehni
6c3fd5953a Simplify Symbol#setDefinition(). 2011-05-07 16:14:12 +01:00
Jürg Lehni
8c7b253bc2 Add Base.splice() to handle lists of items with _index referneces and use it for paper.documents and Item#children. 2011-05-07 16:11:05 +01:00
Jürg Lehni
b44e796475 Make sure getters dont return undefined but null instead. 2011-05-07 16:10:38 +01:00
Jürg Lehni
79f55aa908 Fix recently introduce error in append(). 2011-05-07 15:41:07 +01:00
Jürg Lehni
999fb129cc Some code clean ups. 2011-05-07 15:40:02 +01:00
Jürg Lehni
81c1b2dcce Clean up Path#_add() a bit. 2011-05-07 15:38:36 +01:00
Jürg Lehni
450d277fb4 Avoid necessity of try-catch around code evaluation by declaring all local variables that we are looking for. 2011-05-07 15:38:14 +01:00
Jürg Lehni
afe61d61ac Fix recently introduced errors in setting of Tool#_document. 2011-05-07 15:37:12 +01:00
Jürg Lehni
9ef542ff9a Add comment to #_canged(). 2011-05-07 14:57:20 +01:00
Jürg Lehni
3ff2880ca8 Make Item#setDocument() and #removeFromParent() private. 2011-05-07 14:50:48 +01:00
Jürg Lehni
ef8a2aad9b Remove Tool#setDocument(). 2011-05-07 14:50:31 +01:00
Jürg Lehni
2f6fbcba74 Check result from removeFromParent(). 2011-05-07 14:34:57 +01:00
Jürg Lehni
59e2783979 Use tripple equal operators for string compares now. 2011-05-07 14:32:27 +01:00
Jürg Lehni
4bd12feb49 Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-07 14:18:50 +01:00
Jürg Lehni
4e6e855461 Change '// TODO: Port' comments to '// PORT:'. 2011-05-07 14:18:27 +01:00
Jonathan Puckey
ba6139cd48 Merge remote branch 'origin/master' 2011-05-07 13:56:03 +01:00
Jonathan Puckey
97b7dacfa2 Tool: check for event first, before checking for event.targetTouches. 2011-05-07 13:51:26 +01:00
Jürg Lehni
430a8fb290 Do not pass document as the item for Document#currentStyle. 2011-05-07 13:39:40 +01:00
Jürg Lehni
dabc2b97ed Implement change-notification in a proper way, using ChangeFlags that tell it what exactly has changed, and clearing caches accordingly. 2011-05-07 13:39:17 +01:00
Jürg Lehni
53cc1cd908 Apply #position optimisation through caching to all items, not just PlacedSymbol. 2011-05-07 13:13:19 +01:00
Jürg Lehni
1413094be2 Shorten PlacedSymbol#initialize(). 2011-05-07 13:12:46 +01:00
Jürg Lehni
15b7cfec0b Shorten Item#translate(). 2011-05-07 13:09:04 +01:00
Jürg Lehni
72976f4191 Use internal _position in PlacedItem and transform it along when a matrix is applied. 2011-05-07 11:36:16 +01:00
Jürg Lehni
34785534e0 Use getPosition() rather than getBounds().getCenter(). 2011-05-07 11:25:46 +01:00
Jürg Lehni
17b5354773 Include util files at the end of the library, not the beginning. 2011-05-07 11:24:01 +01:00
Jürg Lehni
6af787e475 Move access to Numerical.TOLERANCE out of the injection scope into getBounds(), so util files can be included at the end of the library again. 2011-05-07 11:23:46 +01:00
Jürg Lehni
3a5aa466de Add comments about things to change. 2011-05-07 10:07:21 +01:00
Jürg Lehni
53a4685248 Merge branch 'master' of github.com:scriptographer/paper.js 2011-05-07 09:56:46 +01:00
Jürg Lehni
6083faaf80 Use getter instead of beans property. 2011-05-07 09:56:27 +01:00
Jürg Lehni
5e4369d800 No need to call setter, we can set internal property directly here. 2011-05-07 09:55:56 +01:00
Jonathan Puckey
74dd89a68b Use Point#read in Point#min and Point#max. 2011-05-06 15:37:55 +01:00
Jürg Lehni
91919987a6 We need the paper object before including utils. 2011-05-06 13:45:18 +01:00
Jürg Lehni
819c1c098c Clean up BlendMode code, and add comments about things not working yet. 2011-05-06 13:41:36 +01:00
Jürg Lehni
0fc7216f1c Fix typos introduced in recent commit. 2011-05-06 13:40:43 +01:00
Jürg Lehni
8a4fe7eb42 Tiny code simplification. 2011-05-06 13:29:21 +01:00
Jürg Lehni
1e7fab2cbc Rearrange file sequence to have utils first. 2011-05-06 13:29:05 +01:00
Jürg Lehni
c36db3a55c Introduce private faster Matrix#_transform* methods that lack arguments checks, and use them internally. 2011-05-06 13:28:35 +01:00
Jürg Lehni
aed1bb0878 Use Numerical.TOLERANCE instead of hardcoded one. 2011-05-06 12:06:05 +01:00
Jürg Lehni
218c7ce2fc Use Paperjs.org blue instead of that other blue. 2011-05-06 12:04:18 +01:00
Jürg Lehni
66602c9cec Remove comment about necessity to reverse coordinate system. 2011-05-06 01:27:47 +01:00
Jürg Lehni
0b082289a6 Simplify Path#arcTo() a lot (get rid of necessity to reverse coordinate system in y-direction, etc). 2011-05-06 01:26:23 +01:00
Jürg Lehni
18ef19649c Remove comment about unnecessary change. 2011-05-06 00:45:46 +01:00
Jürg Lehni
680ae49ec8 Clean up code a bit and add comment about possible further optimsiations. 2011-05-06 00:44:54 +01:00
Jürg Lehni
a3065a59d1 Simplify Path#arcTo(). 2011-05-06 00:42:10 +01:00
Jürg Lehni
a4b37a6278 Simplify addJoin(). 2011-05-06 00:39:44 +01:00
Jürg Lehni
a3da96e8be Remove notify parameter again from _add(). 2011-05-06 00:18:56 +01:00
Jürg Lehni
20cf32d599 Resolve question about wether last segment should be included in join or not. 2011-05-06 00:14:09 +01:00
Jonathan Puckey
6fa993a2a5 Implement equals function for GradientColor, Gradient & GradientStop. 2011-05-05 20:28:28 +01:00
Jonathan Puckey
140f7dee44 Imlement Stats in the dev version of Paper. 2011-05-05 20:23:22 +01:00
Jonathan Puckey
7e24a9170f Document: subtract the offset of the canvas element from the size of the window when resizing. 2011-05-05 20:19:54 +01:00
Jonathan Puckey
c8f13b4ace Document#initialize: use canvas.attributes.resize instead of canvas.getAttribute('resize'). 2011-05-05 20:18:22 +01:00
Jonathan Puckey
0e42f5be6d Document: when the canvas element that is passed to the constructor has a resize attribute, resize the document to the size of the window whenever the user resizes the window. 2011-05-05 16:17:30 +01:00
Jonathan Puckey
f806c68dc0 Merge remote branch 'origin/master' 2011-05-05 13:22:09 +01:00
Jürg Lehni
b50b0f9e5a Fix bug in Color#equals() resulting in it always returning true. 2011-05-05 13:19:36 +01:00
Jürg Lehni
478002ea1c Add comment about return undefined rather than null for unclear styles, and fix test. 2011-05-05 13:11:40 +01:00
Jürg Lehni
93fe0216d2 Add Path#addSegment(s) and #insertSegment(s) and define #add() and #insert() as a switch between these versions based on the amount and nature of parameters. 2011-05-05 12:35:14 +01:00
Jonathan Puckey
19a767e6f6 Merge remote branch 'origin/master' 2011-05-05 11:42:35 +01:00
Jürg Lehni
7894a48ace Add parameter to Path#_add() that controls wether path is notified of change. 2011-05-05 11:40:46 +01:00
Jürg Lehni
ee6d593620 Cache strokeBounds and bounds only if no transformation matrix is passed. 2011-05-05 11:21:09 +01:00
Jürg Lehni
32ed418bdf Remove unused parameter. 2011-05-05 11:20:37 +01:00
Jürg Lehni
5dfec35dc1 Allow colors to be compare to null. 2011-05-05 11:20:26 +01:00
Jürg Lehni
a59fab0409 Only change style and notify item of change if it differs from current one. 2011-05-05 11:16:26 +01:00
Jürg Lehni
1279e820aa Use arc() instead of rect() to draw handles. 2011-05-05 11:01:20 +01:00
Jürg Lehni
14549a383b Improve Item#_getBounds(). 2011-05-05 00:16:28 +01:00
Jürg Lehni
7334e824f5 Further optimise PathStyle code. 2011-05-05 00:08:55 +01:00
Jürg Lehni
23a29ced98 Optimise and comment PathStyle code. 2011-05-05 00:05:36 +01:00
Jürg Lehni
cc0f4a3f7e Add PathStyle#clone(). 2011-05-05 00:01:17 +01:00
Jürg Lehni
ab9cce137c Separate PathStyle constructor into internal PathStyle.create(item, style) and public PathStyle(style). 2011-05-05 00:00:41 +01:00
Jürg Lehni
bc80c58558 Add Base.formatNumber() to format numbers in the same way as Scriptographer (precision of up to 5 fractional digits) and use it in the various #toString() functions. 2011-05-04 19:42:50 +01:00
Jonathan Puckey
2a65e19656 Merge remote branch 'origin/master' 2011-05-04 18:49:41 +01:00
Jonathan Puckey
648f0d7db6 Tool & Event: support touch events & call onMouseMove (if present) while dragging when there is no onMouseDrag handler. 2011-05-04 18:49:30 +01:00
Jürg Lehni
a5099fd51d Add support for insertion of multiple segments at once to Path#_add(), #add() and #insert(), and change code that relies on these methods. 2011-05-04 18:42:40 +01:00
Jürg Lehni
bdbbca487f Remove rounding in drawSelectedBounds(). 2011-05-04 17:44:08 +01:00
Jürg Lehni
3eb17f2953 Refrain from hacker style. 2011-05-04 15:20:42 +01:00
Jürg Lehni
13dd088043 Shorten Base.read() a bit. 2011-05-03 12:10:11 +01:00
Jürg Lehni
6b4f142838 Improve Base.readAll() to check entries for arrays and pass them to constructors as arguments rather than their containing array. 2011-05-03 12:06:59 +01:00
Jürg Lehni
49645f8a0d Do not use short-forms and syntax magic in core API. 2011-05-03 09:34:07 +01:00
Jürg Lehni
728bf0441c Clean up Path#moveTo() and #lineTo() commands. 2011-05-03 09:12:07 +01:00
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