Commit graph

1267 commits

Author SHA1 Message Date
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
da670b4171 Improve comments. 2011-05-16 18:29:53 +01: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
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
fc776f03eb Add Rectangle#transformCornerCoordinates() and use it in Item.drawSelectedBounds(). 2011-05-16 11:25:39 +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
3a15360efc Rename ChangeFlags.PATH to GEOMETRY. 2011-05-16 00:01:06 +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
ef0347a6bc Fix accidental internal bean access to #segments. 2011-05-15 19:58:29 +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
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
252a3635dc Replace {@true} tags in documentation ({@true ([^}]*)} -> true $1, false otherwise.) 2011-05-15 15:06:10 +01:00
Jürg Lehni
ee8b66e19a Remove methods / fields that are hidden on Scriptographer through @jshide. 2011-05-15 15:03:33 +01:00
Jürg Lehni
2c078d8b17 Remove all code blocks and group titles from documentation since we're relying on Scriptographer code and documentation generation (through javadoc) for docs. 2011-05-15 15:01:59 +01:00
Jonathan Puckey
3f8f539aeb Fix bugs in Raster#getAverageColor. 2011-05-15 14:13:47 +02: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
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
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
a775e66632 Do not use #splice() for the initial push to the documents / children list. 2011-05-14 12:42:52 +03:00
Jonathan Puckey
34077dc901 Item#_getBounds: don't include bounds of hidden items. 2011-05-08 17:17:54 +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
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
d254d9542d Add ChangeFlags.HIERARCHY, for future change notifications when children get rearranged. 2011-05-07 16:52:54 +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
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
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
2f6fbcba74 Check result from removeFromParent(). 2011-05-07 14:34:57 +01:00
Jürg Lehni
4e6e855461 Change '// TODO: Port' comments to '// PORT:'. 2011-05-07 14:18:27 +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
3a5aa466de Add comments about things to change. 2011-05-07 10:07:21 +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
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
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
32ed418bdf Remove unused parameter. 2011-05-05 11:20:37 +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
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
bdbbca487f Remove rounding in drawSelectedBounds(). 2011-05-04 17:44:08 +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
52a73e86ce Clean up code (for() -> for ()). 2011-05-03 08:54:13 +01:00
Jonathan Puckey
41120cf4d9 Various small code cleanups. 2011-05-02 12:23:42 +02:00
Jürg Lehni
cd58351864 Add comment about porting chainable calls back to Sg. 2011-04-30 22:30:54 +01:00
Jürg Lehni
4d999d57e2 Replace all type converting string compares with ===, !==. 2011-04-28 13:23:17 +01: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
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
6b6f27cb6e Add TODOs about not returning -1 for undefined. 2011-04-27 17:53:59 +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
Jürg Lehni
bdfe35d93a Consistently name local context variables 'ctx', to save line size and acknowledge the fact that Canvas contexts have a funny API design. 2011-04-26 15:39:16 +01:00
Jonathan Puckey
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
cf541901dd Rename getSelected methods to isSelected. 2011-04-21 19:51:49 +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
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
8a113a1c84 Item: clean up white space. 2011-04-12 14:37:52 +02:00
Jonathan Puckey
d02885cba7 Implement Item#isParent and add tests for it. 2011-04-11 19:42:03 +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
7ae504e51f Add support for Item#removeOnMove(). 2011-03-20 00:11:02 +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
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
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
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
526711ffd4 Fix and improve performance of Raster#getPixel. 2011-03-09 13:38:58 +01: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
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
e1a7aff2f0 Add copyright notice and license file. 2011-03-07 00:50:44 +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
2d4cf2cc72 Replace beans access to Item#position with getter calls. 2011-03-06 21:12:11 +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
162dab66a7 Clean up code. 2011-03-06 15:15:21 +00:00
Jürg Lehni
78c7f645ab Merge remote-tracking branch 'origin/master' 2011-03-06 14:45:57 +00: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
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
0a690788ef Allow chaining of Item transform functions. 2011-03-06 11:42:08 +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
3f0a45a7c2 Allow Rasters to be created directly from id strings. 2011-03-05 14:17:32 +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
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
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
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
93c3920505 Add definition of Base.capitalize() and remove dependencies of String#capitalize(). 2011-03-04 19:46:41 +00: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
2b6dede883 Clean up white-spaces and line lengths. 2011-03-03 22:45:17 +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
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
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
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
b29a87653d Replace % 2 with & 1 (modulo 2). 2011-03-03 12:46:31 +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
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
ab9d07501e Simplify code a bit, by chainging variable declarations. 2011-03-02 16:08:11 +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
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
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
285f81f363 Support PlacedSymbol opacity. 2011-02-28 18:31:51 +01:00
Jonathan Puckey
74f797a9dd Clean up whitespace. 2011-02-28 18:30:08 +01:00
Jonathan Puckey
12859d7a24 Item: pass on param object to Item#draw. 2011-02-28 16:41:24 +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
Jonathan Puckey
461aa87211 Group: add todo. 2011-02-26 15:55:58 +01:00
Jonathan Puckey
422b8911b8 Fix PlacedSymbol#transformContent. 2011-02-26 13:33:13 +01:00
Jonathan Puckey
71bf8dba88 Item: remove logging statement. 2011-02-26 02:04:18 +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
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
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
f1cd24eef8 More work on Raster, including getAverageColor, get/setPixel, get/setSize. 2011-02-24 01:28:11 +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
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
357a8af6ec Clean up white spaces. 2011-02-21 03:32:39 +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
cb40d3f6f4 Implement Symbol and PlacedSymbol. Add Document#symbols array. 2011-02-20 18:34:38 +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
c2849b3692 Change PathStyle, CompoundPath and Path to work with new Color classes. 2011-02-19 17:25:16 +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
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
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
9a9005a604 Correct comments about transform flags. 2011-02-15 22:57:12 +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
30fef4d147 Group: use internal _clipped variable, so we don't collide with getters/setters. 2011-02-14 22:51:31 +01: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
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
604ff7824c Add comment about ideally not relying on parent.children.indexOf for getIndex(). 2011-02-13 18:51:49 +00:00
Jürg Lehni
08d4826441 Reformating code to follow Scriptotgrapher coding conventions. 2011-02-13 16:26:24 +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
c0e2101c32 Clean up src directory and move Bootstrap.js into lib. 2011-02-12 17:59:39 +01:00