Jürg Lehni
f433423789
Respect _applyMatrix setting when calling #applyMatrix() in Group#_changed.
...
Required for Clip to work correctly.
2013-06-18 15:39:46 -07:00
Jürg Lehni
75acdf1025
Add support for direct drawing of native blendModes for items that allow it.
...
Bypassing compositing into separate canvases completely.
2013-06-18 14:18:57 -07:00
Jürg Lehni
ad6124cf98
Take strokeWidth into account in Item#hasStroke()
2013-06-18 14:08:48 -07:00
Jürg Lehni
f4f97cda88
Fix a bug with wrong offsets when rendering nested clips and blend-modes.
...
And streamline blend-mode and opacity rendering code.
2013-06-18 12:35:57 -07:00
Jürg Lehni
414ac1d092
Fix offset in direct blitting of nested Clip items.
2013-06-18 12:20:21 -07:00
Jürg Lehni
f350f34eb4
Apply clipping fix not only to blend modes but any operation that draws into a separate canvas.
2013-06-17 16:22:23 -07:00
Jürg Lehni
ab2bfe2d40
Rename nativeDash to dash.
2013-06-17 15:52:16 -07:00
Jürg Lehni
d6db007765
Fix documentation warning.
2013-06-13 15:57:12 -07:00
Jürg Lehni
ae474131cc
Implement stroke hittesting for Shape.Rectangle.
2013-06-13 10:40:54 -07:00
Jürg Lehni
48fa889e0d
Start implementing proper hit-testing for Shapes with strokes.
...
Support for Shape.Rectangle is still missing.
2013-06-13 10:31:21 -07:00
Jürg Lehni
40dbe7ec74
Fix drawing of Shape.Ellipse items.
2013-06-13 10:30:54 -07:00
Jürg Lehni
7f6ac3d8af
Changing HIERARCHY also changes GEOMETRY.
...
Fixes #237 .
2013-06-13 08:47:45 -07:00
Jürg Lehni
5250281ab1
Fully support object literal arguments in Shape constructors.
2013-06-12 20:13:39 -07:00
Jürg Lehni
95ecab8a6f
Improve handling of merged CompoundPath style through #getStyle().
...
Only access _style directly in core code if you really know what you're doing!
2013-06-12 20:12:08 -07:00
Jürg Lehni
33eb750586
Simplify Path#hasFill() and implement #hasStroke() as well.
2013-06-12 19:57:05 -07:00
Jürg Lehni
fe10c99d1b
Implement standard behavior of #_hitTest() for items without children, based on #_contains().
...
This should cover the minimum of what's needed for PointText.
2013-06-12 19:30:23 -07:00
Jürg Lehni
34ad9045cc
Fix wrong default fillColor on TextItems.
2013-06-12 17:30:35 -07:00
Jürg Lehni
b581f8b33e
Implement Style#selectedColor and Item#selectedColor as a way to control appearance of selections.
...
Closes #219 .
2013-06-12 14:17:34 -07:00
Jürg Lehni
8c596927fb
Store _removeSets per project, not globally.
2013-06-12 13:50:05 -07:00
Jürg Lehni
94e07e77f0
Redraw clipItem when drawing into separate canvas for blend-modes.
...
Closes #228 .
2013-06-11 20:41:20 -07:00
Jürg Lehni
20f7c567aa
Use Base objects for drawing params, so we can use param.extend() on them for easier overriding.
2013-06-11 20:40:44 -07:00
Jürg Lehni
d76d573eb2
Reset transformation matrix when blitting off-screen canvas.
...
Closes #233 .
2013-05-29 13:52:47 -07:00
Jürg Lehni
0e2ae48b02
Fix regressions in Raster caused by faulty merge.
2013-05-28 13:54:47 -07:00
Jürg Lehni
73351cbda7
Store data in _data rather than on the image itself.
2013-05-28 08:10:51 -07:00
Jürg Lehni
c75a98c406
Clean up @trankek's fix for node a bit.
...
Fix prepro.js conditionals.
2013-05-28 08:05:40 -07:00
Jürg Lehni
e0856a0d31
Merge branch 'master' of https://github.com/tranek/paper.js into tranek-master
...
Conflicts:
src/item/Raster.js
2013-05-28 08:00:01 -07:00
Jürg Lehni
6fa6c022c9
Rename options.server to options.node
2013-05-28 00:01:55 -07:00
Jürg Lehni
cd7db56249
Remove all create() constructors for basic types since new constructors are now faster.
...
Woop!
2013-05-27 23:57:31 -07:00
Jürg Lehni
4e6f52c20c
Remove need for _needsRedraw() calls by replacing it with a boolean flag.
2013-05-27 23:40:23 -07:00
Jürg Lehni
fd3f698fe9
Apply "pending" matrix in group when it receives content.
2013-05-27 23:13:20 -07:00
Jürg Lehni
9b0d32651f
Move main Item insertion code from #insertChild() to #insertChildren().
...
Handles insertion and change notification much more efficiently.
2013-05-27 20:06:30 -07:00
Jürg Lehni
73388d6f9c
Fix documentation warning.
2013-05-27 18:30:57 -07:00
Jürg Lehni
e516e6f651
Only reset matrices in Groups when it could actually be applied to the content.
...
That way, empty groups in SVGImport still keep their transformation state.
2013-05-27 15:42:16 -07:00
Jürg Lehni
10d5de3ed6
Implement a better way to name and export class constructors.
...
This change also simplified the way classes are exported to PaperScope objects.
2013-05-27 12:48:58 -07:00
Jürg Lehni
c533dda7b5
Finally found a better and faster alternative for this.base() calls, by setting base on the function object instead.
...
base can be accessed on named functions very easily, leading to another measurable speed increase. Finally all performance reasons against straps.js are eliminated!
2013-05-27 10:04:05 -07:00
Jürg Lehni
369b329b23
Change straps.js to directly use initialize() as constructor function rather than redirecting calls to it.
...
Should yield some interesting performance improvements.
2013-05-27 09:11:50 -07:00
Jürg Lehni
094e35f2e5
No need for separate injection object for Item.extend()
2013-05-27 08:16:34 -07:00
Jürg Lehni
7f00ef8f05
Fix white-spaces.
2013-05-24 22:25:22 -07:00
tranek
1637127e09
Fixed data URLs src disappearing
2013-05-24 20:55:59 -04:00
tranek
cd7938e363
Fixed string equals in Raster data URL for Node.js
2013-05-24 16:41:02 -04:00
tranek
269b93e888
Added data URLs for Rasters in Node.js
2013-05-24 16:38:43 -04:00
Jürg Lehni
ae416f821c
Explain the booolean argument in color getter calls, and put _matrix in local variable for better minification.
2013-05-13 19:31:41 -07:00
Jürg Lehni
7c2e57e105
Remove Item#applyMatrix boolean, go back to previous way of directly applying transformations to children in Group and Layer, and introduce new Clip class for non-transformed nested matrices.
2013-05-13 18:57:17 -07:00
Jürg Lehni
f34fe102a4
Use new alias notation for deprecated functions, wherever we can.
2013-05-06 21:01:04 -07:00
Jürg Lehni
b59a98f7ce
Add jQuery style aliases to Callback and use #on() in the examples rather than #attach().
2013-05-06 20:56:58 -07:00
Jürg Lehni
883e3ad563
Define CurveLocation#intersection as a way to retrieve the CurveLocation on the intersecting path when using Path#getIntersections().
2013-04-30 18:41:26 -07:00
Jürg Lehni
420fb49230
Speed up Raster#getPixel().
2013-04-24 18:09:58 -07:00
Jürg Lehni
ead3646581
Handle alpha channels correctly in Raster#get/setPixel.
...
Closes #209 .
2013-04-24 16:29:28 -07:00
Jürg Lehni
96d9b6730f
Rename Svg acronyms in API to SVG.
2013-04-23 07:19:08 -07:00
Jürg Lehni
cebeb11301
Rename Json acronyms in API to JSON.
2013-04-23 07:13:51 -07:00
Jürg Lehni
faecb7e78a
Allow creation of items when project has no layers.
2013-04-22 23:25:34 -07:00
Jürg Lehni
1b61e4333c
Implement Project#clear().
2013-04-22 22:48:36 -07:00
Jürg Lehni
885d75296d
Fix Layer#isInserted() for nested Layers.
2013-04-22 22:47:48 -07:00
Jürg Lehni
6800a6d534
Use separate id ranges for different classes.
2013-04-22 19:09:59 -07:00
Jürg Lehni
2a53dbe60f
Restructure Color constructor to remove need for Color.create().
2013-04-22 19:07:38 -07:00
Jürg Lehni
2fc4ff10ee
Implement Item#_contains() with local coordinates, and have Item#contains() take Item#matrix into account.
2013-04-21 08:43:05 -07:00
Jonathan Puckey
a5997dcc24
Add example to Item#contains(point) docs.
2013-04-21 13:56:29 +02:00
Jonathan Puckey
daf8d0f881
Rename 'properties' constructor parameter to 'object' in docs.
2013-04-21 13:54:31 +02:00
Jonathan Puckey
0369f5aea9
Fix mistake in example code.
2013-04-21 13:53:13 +02:00
Jürg Lehni
4b24690207
Implement Shape#contains() and define unit tests for it.
2013-04-20 20:54:06 -07:00
Jürg Lehni
2793709935
Fix wrong Shape.Circle size.
2013-04-20 20:53:40 -07:00
Jürg Lehni
db7eb65bd7
Implement Item#contains() and use it for hit-testing Rasters.
2013-04-20 20:41:52 -07:00
Jürg Lehni
bb03c72ce8
Implement Item#hasFill().
2013-04-20 20:40:20 -07:00
Jürg Lehni
acd3236989
Optimize Shape constructors by passing along point.
2013-04-20 20:24:16 -07:00
Jürg Lehni
3025c63179
Simplify Style creation.
2013-04-19 20:00:30 -07:00
Jürg Lehni
e1807214f4
Large refactoring of Style handling for notable speed improvements.
2013-04-19 19:31:29 -07:00
Jürg Lehni
98f7c020bd
Use Item#type instead of instanceof checks for better performance.
2013-04-19 19:27:02 -07:00
Jürg Lehni
bf9acd4499
Correct Numerical.KAPPA value.
2013-04-19 18:57:31 -07:00
Jürg Lehni
9da392a99c
Commit initial support for Shape class.
...
Hit testing is still missing.
2013-04-19 17:25:50 -07:00
Jürg Lehni
9cc0822477
Move PlacedItem#_hitTest() to PlacedSymbol#_hitTest() since it was written for symbols, and remove PlacedItem as it's an empty class now.
2013-04-19 16:40:30 -07:00
Jürg Lehni
8d99aa5f95
Handle color transformation in Item#transform() rather than Path#_applyMatrix().
...
Fixes an issue with BoucingBalls.html, now that CompoundPath#applyMatrix is true.
2013-04-19 13:13:54 -07:00
Jürg Lehni
922b9b5bd0
Rename _cloning parameter to _preserve.
2013-04-19 11:54:16 -07:00
Jürg Lehni
517b2ee27f
Inline Item.drawSelectedBounds() code.
2013-04-18 17:07:32 -07:00
Jürg Lehni
9ee8590a4d
Move Item.draw() to Item#draw().
...
Makes more sense this way.
2013-04-18 17:04:06 -07:00
Jürg Lehni
d23e21edd7
Make Item#draw() protected, so we know to not directly call it.
2013-04-18 16:58:35 -07:00
Jürg Lehni
d1c6b7134f
Fix Raster#getAverageColor() to work with new transforms history code.
2013-04-18 16:50:18 -07:00
Jürg Lehni
c50b940ff3
Fix Item#rasterize() to work with new matrices history code.
2013-04-18 16:23:27 -07:00
Jürg Lehni
d2b43b043a
Fix comment.
2013-04-16 19:41:45 -07:00
Jürg Lehni
2c3e8a32ab
Handle nested matrices correctly when drawing blend modes or transparency.
...
Closes #194 .
2013-04-09 20:01:10 -07:00
Jürg Lehni
f79e561512
Handle bounds correctly for groups with only empty children.
2013-04-09 19:24:41 -07:00
Jürg Lehni
0f19e72733
Minor tweaks.
2013-04-09 19:12:47 -07:00
Jürg Lehni
b55d89acda
Move handling of clipping outside of draw function, so canvas context can correctly be saved and restored for clipping paths too.
2013-04-09 19:08:41 -07:00
Jürg Lehni
90cc10cc4b
Calculate _globalMatrix for all drawn items and use it for the drawing of selections.
2013-04-09 18:52:47 -07:00
Jürg Lehni
8da8f116d1
Restructure style related class organization.
2013-04-09 17:08:09 -07:00
Jürg Lehni
b3b0fa649b
Minor Style refactoring clean-ups.
2013-04-09 16:51:57 -07:00
Jürg Lehni
b4a99415d0
Merge PathStyle, CharacterStyle and ParagraphStyle into Style.
...
Closes #130 .
2013-04-09 16:46:20 -07:00
Jürg Lehni
d3bb68d0e0
Use faster Array construction.
2013-04-09 07:55:09 -07:00
Jürg Lehni
01673d675d
Fix issues with new Color serialization.
2013-04-08 13:10:49 -07:00
Jürg Lehni
a48e6e5bf9
More work on Color refactoring.
2013-04-08 00:11:43 -07:00
Jürg Lehni
218732e320
Implement a row of simple optimizations to increase performance of Item constructors.
2013-04-07 17:36:09 -07:00
Jürg Lehni
232ea221b4
First batch of large Color refactoring and simplification.
...
Work in progress.
2013-04-07 10:03:51 -07:00
Jürg Lehni
18ed9010a6
Derive Item#type from Item#_class and use that instead in code that depends on Item types.
2013-04-06 18:07:30 +02:00
Jürg Lehni
f43b322d2a
Rename Base#_type property to #_class.
2013-04-06 09:16:08 +02:00
Jürg Lehni
d0c763f27d
Use CanvasContext#save() and #restore() in Item#rasterize().
2013-03-19 21:36:11 -07:00
Jürg Lehni
9c38a76525
Add support for Item#data serialization.
2013-03-19 17:52:46 -07:00
Jonathan Puckey
58247ea232
Fix bug in Raster#getSubImage and add test.
2013-03-17 18:57:16 +01:00
Jonathan Puckey
0d3f746c10
Have Raster constructor set Raster#_size to [0, 0] if it was not set.
2013-03-17 17:04:56 +01:00
Jonathan Puckey
5777c7a772
Fix problem where calling new Raster().setSize(size) threw an error.
2013-03-17 16:55:57 +01:00
Jonathan Puckey
f4c1f6a3c1
Remove todo.
2013-03-17 16:40:59 +01:00
Jonathan Puckey
9f466bbc97
Fix mistake in Raster#setPixel.
2013-03-17 16:39:23 +01:00
Jonathan Puckey
1cfe34089a
Remove double space in docs.
2013-03-17 15:01:30 +01:00
Jonathan Puckey
2b7f526c62
Fix hit-testing documentation: change options.guide to options.guides.
2013-03-16 14:16:02 +01:00
Jonathan Puckey
b76f69b517
Improve Layer documentation.
2013-03-16 14:03:13 +01:00
Jonathan Puckey
7ee7a26ef4
Improve item documentation.
2013-03-16 14:02:59 +01:00
Jonathan Puckey
b23a4ede56
Improve Group documentation.
2013-03-16 13:44:58 +01:00
Jonathan Puckey
28d21bf5b1
Improve Raster documentation.
2013-03-10 23:19:59 +01:00
Jonathan Puckey
d8b0da9103
Fix small bug in Raster constructor.
2013-03-10 22:15:28 +01:00
Jonathan Puckey
71b63b0e9d
Fix documentation.
2013-03-10 19:06:37 +01:00
Jonathan Puckey
fd3fc7f2d7
Implement Item#setParent, making Item#parent writeable. Closes #186 .
2013-03-10 15:35:33 +01:00
Jonathan Puckey
25d34be59b
Implement Item#data. Closes #188 .
2013-03-10 14:59:53 +01:00
Jürg Lehni
1d1e6425fa
Remove all left-overs of call chaining, except for where it's in use.
2013-03-05 20:39:07 -08:00
Jürg Lehni
0e72dbd2e0
Rename Color#getCanvasStyle() to #toCanvasStyle().
2013-03-05 19:58:41 -08:00
Jonathan Puckey
97451320b9
Fix Item#type documentation.
2013-03-04 10:54:08 +01:00
Jürg Lehni
849d3efc2e
Have PathItem#setPathData() clear the previous content.
2013-03-03 16:56:48 -08:00
Jonathan Puckey
fa861f2047
Improve example documentation.
2013-03-03 20:10:25 +01:00
Jonathan Puckey
ef75bee1e5
Item documentation.
2013-03-03 18:05:41 +01:00
Jürg Lehni
0599aabdb9
Handle reinsertion of items into the same children list.
...
Fixes failing test.
2013-03-01 23:06:29 -08:00
Jürg Lehni
4be5d5086f
Introduce project.option.hitTolerance, to control precision of internal hit-tests.
2013-03-01 20:25:46 -08:00
Jürg Lehni
5140e8f003
Minor changes on documentation.
2013-03-01 20:24:26 -08:00
Jürg Lehni
3f5d0a6925
Merge constructor._name with _type and use CamelCase for Item types.
2013-03-01 17:13:22 -08:00
Jürg Lehni
293294a55a
Have #_getCachedBounds() return clones of cached items again.
...
Fixes issue with Tadpoles example.
2013-03-01 16:05:11 -08:00
Jürg Lehni
cd58162dd5
No need to clone _matrix, since _clone() does that for us.
2013-03-01 15:55:19 -08:00
Jürg Lehni
5bbbaef618
Include clipMask in serialization.
2013-03-01 15:30:45 -08:00
Jürg Lehni
7405858f32
Simplify code for reading of named arguments, removing the need for filtering arguments by using 'in' checks instead for the presence of properties / setters.
2013-03-01 14:06:04 -08:00
Jürg Lehni
5501f48570
Move Item#toString() functionality to Base#toString().
...
For objects that define #_id and/or #_name.
2013-03-01 11:47:49 -08:00
Jürg Lehni
01026c0896
Fix support for viewBox when importing SVG symbols.
2013-03-01 10:08:17 -08:00
Jürg Lehni
cef30f9dd1
Switch to #pathData for JSON serialization of Path and CompoundPath.
2013-02-28 19:41:13 -08:00
Jürg Lehni
65a9795a8a
Rename #from/#toJson() to #import/#exportJson() and move them to Project / Item.
...
To reflect naming of #import/#exportSvg().
2013-02-25 16:17:33 -08:00
Jürg Lehni
326d8db4db
Do not hittest locked items.
2013-02-24 18:04:20 -08:00
Jürg Lehni
0d98727328
Simplify drawing of seleced bounds by having Item#_boundsSelelected default to true for Raster, PlacedSymbol and TextItem.
...
One can now turn it off for these using item.bounds.selected = false;
2013-02-24 15:53:37 -08:00
Jürg Lehni
6b7c6b6c4c
Implement Item#bounds.selected to control drawing of selected item bounds.
2013-02-24 15:41:31 -08:00
Jürg Lehni
afac35fabf
Improve handling of bounds caching.
...
Cloning was done in the wrong place.
2013-02-24 14:56:51 -08:00
Jürg Lehni
ac8c9cd114
Include ChangeFlag.GEOMETRY in Change.CONTENT.
...
Closes #173 .
2013-02-21 00:09:40 -08:00
Jürg Lehni
119e5acbf9
Move #_setProperties() and #set() from Item to Base, rename it to #_set and use it for Tool too.
2013-02-15 18:28:49 -08:00
Jürg Lehni
d3ccec2256
Use the code from Group#isEmpty() and CompoundPath#isEmpty() for Item#isEmpty(), since any item that does not have children overrides it.
2013-02-15 18:01:23 -08:00
Jürg Lehni
eebcbda9d3
Document 2nd argument in Raster#initialize() as well, and rename arguments.
2013-02-15 08:15:24 -08:00
Jürg Lehni
a688301106
Document Raster#initialize().
2013-02-15 08:12:58 -08:00
Jürg Lehni
bd5f0691e6
Do not serialize styles on Groups and Layers, since they just unify their children's own styles.
2013-02-14 21:54:52 -08:00
Jürg Lehni
4cd069b1af
Clean up code and add comment about consumed canvas again.
2013-02-14 19:42:20 -08:00
Jürg Lehni
53b36111dd
Merge pull request #150 from yscik/rasterize-opacity
...
Group opacity disregarded in rasterize
2013-02-14 19:40:45 -08:00
Jürg Lehni
334fe99503
Revert recent changes to Item#rasterize() so pull request #150 can be merged.
2013-02-14 19:40:30 -08:00
Jürg Lehni
47a3490007
Take item matrix into account in Item#rasterize().
...
Closes #144 .
2013-02-14 19:25:04 -08:00
Jürg Lehni
366ba2897b
Do not blit rasters into separate canvas when they have opacity set.
...
Closes #166 .
2013-02-14 12:28:11 -08:00
Jürg Lehni
e9fef8a53c
Fix a couple of newly introduced bugs through CanvasProvider change.
2013-02-12 16:23:30 -08:00
Jürg Lehni
ea1e7fccb9
clearRect() needs + 1 for size.
2013-02-12 16:07:24 -08:00
Jürg Lehni
ca3cc7f46d
Define CanvasProvider.getContext() next to getCanvas(), and support both types in release().
2013-02-12 16:06:24 -08:00
Jürg Lehni
9600fdb512
Fix a recently introduce but in Raster#getCanvas().
2013-02-12 15:54:56 -08:00
Jürg Lehni
357b7dbc54
Shorten CanvasProvider method names.
2013-02-12 15:53:27 -08:00
Jürg Lehni
24d467e292
Implement support for native dash strokes, through both setLineDash() and mozDash.
2013-02-12 15:32:21 -08:00
Jürg Lehni
fdd15e675f
Add options argument to #toJson() methods, and use to implement optional fractional digit precision control.
2013-02-12 14:57:54 -08:00
Jürg Lehni
053aa15ded
Rename Raster's ImageData code from *Data to *ImageData, to avoid clash with future Item#data.
2013-02-12 14:40:55 -08:00
Jürg Lehni
e7bb334c6a
Use JSON dictionary support to serialize Symbols and PlacedSymbol references.
2013-02-11 18:59:49 -08:00
Jürg Lehni
00dcd05549
Implement support for dictionary definitions and references in JSON serialization.
2013-02-11 18:59:05 -08:00
Jürg Lehni
224563d5f7
Include more Item attributes for serialization.
2013-02-11 17:13:44 -08:00
Jürg Lehni
489a785171
Override Item.extend() to merge the subclass' _serializeFields with the parent class' _serializeFields.
...
And have style fields always serialized in non-compact form for Color.
2013-02-11 17:08:23 -08:00
Jürg Lehni
6d39a91c87
Implement simple Project serialization.
2013-02-11 16:43:31 -08:00
Jürg Lehni
e829440803
Have Raster serialize itself.
...
The source property either contains the link to the external source, or the data url.
2013-02-11 16:43:10 -08:00
Jürg Lehni
e5180e6929
Implement Raster#getElement(), returning either the internal native canvas or image element.
...
And use it internally in various places.
2013-02-11 16:42:36 -08:00
Jürg Lehni
080a9b220a
Handle Raster#onLoad() callback for inlined images.
...
Code can now switch back and forth between inlined images and external sources.
2013-02-11 16:35:46 -08:00
Jürg Lehni
cf6ba30258
Have Raster#image only return an image, not a canvas element.
2013-02-11 16:34:59 -08:00
Jürg Lehni
0954dc3823
Better deal with security exceptions and missing image data in Raster.
2013-02-11 16:34:31 -08:00
Jürg Lehni
565fb86430
Give any item / object that needs to be exported as a definition / symbol its own unique id.
...
This will be useful in SVG and JSON exporter.
2013-02-10 09:37:40 -08:00
Jürg Lehni
cd9fc39f54
Rename Matrix#setIdentity() to #reset() and document it.
2013-02-09 11:45:33 -08:00
Jürg Lehni
15c8652747
Add support for Raster to SvgExport.
2013-02-09 09:44:25 -08:00
Jürg Lehni
dc35fdbd02
Move named inner functions out of nested scopes, to prepare for 'use strict;' transition.
2013-02-08 18:23:33 -08:00
Jürg Lehni
02ca95eb46
Avoid accidental global leakage.
2013-02-08 16:12:57 -08:00
Jürg Lehni
6c9c16ad3d
Update copyright information comments, and year.
2013-01-28 18:03:27 -08:00
Jürg Lehni
8bab10cb5f
Define Item#sendToBack() and #bringToFront().
2013-01-20 17:08:49 -08:00
Jürg Lehni
e4d98f7865
Add internal _cloning parameter to all insertion methods.
2013-01-20 16:14:30 -08:00
Jürg Lehni
18572276c5
Fix a bug with new _drawCount code.
...
Make sure items are considered selected right away if they are part of the DOM, even before they are getting drawn for the first time.
2013-01-20 15:56:58 -08:00
Jürg Lehni
50ee598bca
Introduce Project#_drawCount mechanism as a better and more efficient way to filter out selected items that are not currently part of the DOM.
2013-01-20 14:01:43 -08:00
Jürg Lehni
e22b3292ed
Define a fallback for #drawSelected(), for classes that don't have it yet.
2013-01-20 14:01:43 -08:00
Jürg Lehni
7756e90ff9
Make sure cloned items do not receive the same name when placed inside the same parent, use numbered versions instead.
2013-01-20 14:01:43 -08:00
Jürg Lehni
5a2be6d545
No need for chainable functions on Item types.
2012-12-31 21:42:14 +01:00
Jürg Lehni
5da4e89672
Return 'this' in more places to facilitate chained calls inside the library.
2012-12-31 20:07:28 +01:00
Jürg Lehni
8bed8cb15d
Define mechanism for flexible reading of named arguments through Base.readNamed() and Base.hasNamed(), and use it to implement property object literal versions of Path.Constructor code.
2012-12-30 18:24:33 +01:00
Jürg Lehni
24b5f870bd
Change Base.isObject() to also check for instances of plain Base objects, and rename it to Base.isPlainObject().
2012-12-30 17:30:13 +01:00
Jürg Lehni
2abefee336
Merge Base.readValue() with Base.read() and rename Base.peekValue() to Base.peek().
...
When called directly on Base, read() reads values, otherwise the specific type of the subclass it is called on.
2012-12-30 16:07:20 +01:00
Jürg Lehni
4f83e0eee6
Commit first version of serialization / deserialization mechanism.
...
It appears to work fine already for Paths and Groups.
2012-12-27 12:45:55 +01:00
Jürg Lehni
ae4e5d4be5
Rename Item#setProperties() to hidden #_setProperties() and add public Item#set() to use same functionality from outside.
2012-12-27 00:52:09 +01:00
Jürg Lehni
3b88bffff1
Document #setProperties() method.
2012-12-26 13:29:40 +01:00
Jürg Lehni
3ac039bd66
Implement properties object literal initialization for all Item constructors.
2012-12-25 22:12:25 +01:00
Jürg Lehni
6b0b6911b4
Clean up code a bit.
2012-12-25 18:09:42 +01:00
Jürg Lehni
ded73142a9
Simplify pointOrMatrix parameters and only allow points. Also remove internal _point cache from PointText and directly link #point to #matrix.
2012-12-25 17:57:04 +01:00
Jürg Lehni
623bed4c4a
Also clone the applyMatrix property.
2012-12-25 17:08:17 +01:00
Jürg Lehni
8f093f6dd7
Remove all PORT comments, since we won't port back features to Scriptographer.
2012-12-25 16:07:48 +01:00
Jürg Lehni
b54bdadaff
Rename Item#transformContent to #applyMatrix.
2012-12-24 17:39:24 +01:00
Jürg Lehni
1e283fe113
Implement Raster#source and clean up #initialize()
2012-12-24 01:12:41 +01:00
Jürg Lehni
d6fceb928f
Implement Item#transformContent property, which controls wether Item#transform() directly applies transformations to contents, or simply stores them in Item#matrix.
2012-12-24 00:39:42 +01:00
Jürg Lehni
e21ea457a7
Remove Item#apply() and clean up #applyMatrix() and simplify handling.
2012-12-24 00:29:09 +01:00
Peter
1bb7c9f1aa
Use Item.draw in rasterize
2012-12-23 17:52:43 +01:00
Jürg Lehni
734cc1cc61
Undo commit 4445376c0204cb5a2e408c64b77a5b6fa09305ba since it clashes with magnification.
2012-12-21 16:41:57 +01:00
Jürg Lehni
c63e2c8f79
Clean up bounds scope indentation.
2012-12-18 14:19:13 +01:00
Jürg Lehni
9a8dddd7df
Move Item#isEmpty() out of bounds scope and define documentation for it.
2012-12-18 14:18:53 +01:00
Jürg Lehni
b535d9f843
Implement new Bootstrap feature that allows hiding of getter parameters to make sure beans are produced, and use it across the library.
2012-12-15 19:51:31 +01:00
Jürg Lehni
0d2ed108e2
Refactor getBounds code so that functionality can be exposed as static methods on Path.
2012-12-15 08:19:10 -08:00
Jürg Lehni
cf5853c8cc
Improve handling of item based onFrame handlers, by moving functionality to View and removing handlers properly when the view is destroyed.
2012-12-03 09:53:47 -08:00
Jürg Lehni
5b56bd7fbf
Fix item-based onFrame handlers so they can be removed again properly.
2012-12-03 08:49:49 -08:00
Jürg Lehni
a3a7545cb0
Only resize image rasters if the new size is different from the old.
2012-12-02 21:13:03 -08:00
Jürg Lehni
523f5c1789
Avoid multiple triggering of Raster.onLoad() on cached rasters.
2012-12-02 21:05:40 -08:00
Jürg Lehni
d16155f4fe
Fix CompoundPath#clone() so that it does not alter the #clockwise state on its children.
2012-12-01 11:31:03 -08:00
Jürg Lehni
f90ceb06b3
Simplify code that checks for the need of opacity buffering a bit.
2012-12-01 11:06:23 -08:00
Jürg Lehni
398ee1a338
Redraw view once Raster has finished loading.
2012-11-27 14:12:34 -08:00
Jürg Lehni
906faf7956
Improve handling of nested matrices in hit-testing.
...
Closes #134 .
2012-11-23 12:41:00 -08:00
Jonathan Puckey
157a59d315
Merge branch 'master' of https://github.com/paperjs/paper.js
2012-11-23 21:21:20 +01:00
Jonathan Puckey
4c409b37fb
Merge pull request #135 from 0/layer-insert-below
...
Fix insertBelow for Layer items
2012-11-23 12:05:11 -08:00
Jonathan Puckey
151f7026e1
Fix mistake in previous commit.
2012-11-23 20:55:46 +01:00
Jonathan Puckey
43b3ac6beb
Optimize PlacedSymbol#_hitTest a bit.
...
Use faster Point#_transformPoint function to transform point.
2012-11-23 20:48:34 +01:00
Jonathan Puckey
e835ccf786
Remove accidentally committed logging statement.
2012-11-23 20:43:28 +01:00
Jonathan Puckey
90e475b5f9
Support hit-testing of placed-symbols and add test. Closes #131 .
2012-11-23 20:29:36 +01:00
Jürg Lehni
373474d088
Implement loading Rasters from external sources and notify using a 'load' callback.
2012-11-21 10:39:26 -08:00
Dmitri Iouchtchenko
ae7e6ee6b3
Fix insertBelow for Layer objects
2012-11-19 23:41:04 -05:00
Jürg Lehni
e9a9066d7f
Use group creation without explicit array declaration, as that's been supported all along.
2012-11-06 20:37:50 -08:00
Jürg Lehni
c70948c762
Return the inserted item in #addChild() & co, instead of true / false.
2012-11-06 12:44:02 -08:00
Jonathan Puckey
bda7c71fcb
Fix problem when calling new Group([]).
2012-11-06 18:07:51 +01:00
Jürg Lehni
35568c15f2
Implement transparent constant-substitution in prepro.js to shave of some extra bytes of final distribution file.
2012-11-05 18:11:44 -08:00
Jürg Lehni
61531949b0
Rework horizontal / vertical lineto command code a bit.
2012-11-05 08:54:10 -08:00
Jürg Lehni
19d145f281
Introduce Item#type, returning a simple item type string identifier.
2012-11-03 23:43:18 -07:00
Jürg Lehni
63640cad03
Fix issue with hit-testing of translated rasters and other items.
...
Use the untransformed point in the initial bounds check. Closes #45 , #86 .
2012-10-20 16:54:39 -04:00
Jürg Lehni
30374ae3b4
Implement proper index independent argument list reading of basic types.
...
Implemented for Point, Size, Rectangle and Color.
2012-10-18 14:24:15 -07:00
Jürg Lehni
e17e94b50b
Implement Item#isEmpty() for the various types.
...
And use it to tell #getBounds() when to ignore items.
2012-10-10 20:11:11 -07:00
Jonathan Puckey
e3518c29b1
Fix issue where adding the children of one group to another using Item#insertChildren / Item#addChildren does not work.
...
This fixes #119 . To avoid duplication I chose to call
Item#insertChildren from Item#addChildren.
2012-10-06 13:08:07 +02:00
Jürg Lehni
59a55f7574
Merge branch 'master' of github.com:paperjs/paper.js
2012-09-30 14:08:44 -07:00
Jürg Lehni
99ac617ded
Inject HitResults fields as enumerable, so the default #toString works, and avoid listing getColor.
2012-09-30 14:07:27 -07:00
Oliver Beattie
457e96ac2b
Remove unused delta variable from Item.fitBounds
2012-03-17 17:09:59 +00:00
Jonathan Puckey
08c02a66f1
Fix Item#insertAbove(item) & Item#insertBelow(item). Closes #81
2012-03-13 15:58:52 +01:00
Jonathan Puckey
2fff5b4f79
Group: fix clipping. Fixes #66
2012-03-02 11:54:11 +01:00
Jonathan Puckey
a343724094
Item#setName: Check for Item#_parent to avoid errors in removed items and top level groups. Fixes #76
2012-03-01 16:43:05 +01:00
Jürg Lehni
1e0f779ea5
Make the hit test point transformation sticky.
...
So it propagates through the DOM levels.
2011-12-28 09:13:42 +01:00
Jürg Lehni
50e1509ab9
Simplify some code in #getAverageColor().
2011-12-27 20:39:46 +01:00
Jürg Lehni
24c0d0f87e
Fix bug in Raster#getAverageColor().
2011-12-27 19:55:55 +01:00
Jürg Lehni
5093648bd1
Shorten code a bit.
2011-12-27 19:53:37 +01:00
Jürg Lehni
b832787f7f
Fix issues with multiple instances of symbols appearing in the wrong positions.
...
This was caused by cached bounds rectangles being modified elsewhere.
2011-12-27 19:53:28 +01:00
Jürg Lehni
2249f09223
Minor code clean up.
...
No need to set reference again, since we're directly modifying it.
2011-12-26 11:16:16 +01:00
Jürg Lehni
dbd3eff84b
Don't forget to set #_bounds again if recycling.
...
This fixes the other observed slowdown since the bounds caching code overhaul.
2011-12-26 11:15:47 +01:00
Jürg Lehni
873cd79517
Fix a bug in code that keeps #_position cache up to date.
...
Only happened in items that assign another type to 'bounds' through _boundsType, e.g. PlacedSymbol, leading to substantial slow downs.
2011-12-26 11:08:09 +01:00
Jürg Lehni
d2869cfd55
Cached bounds are no longer LinkedRectangles.
2011-12-26 11:06:04 +01:00
Jürg Lehni
c552925426
Fix issue with Item#removeChildren(from, to) removing too many items.
2011-12-26 02:39:54 +01:00
Jürg Lehni
1e690a68e0
Add TODO about HitResult points requiring transformations.
2011-12-25 12:39:10 +01:00
Jürg Lehni
951a3aea99
Inverse-transform the passed point on each DOM level in #hitTest().
2011-12-25 00:19:44 +01:00
Jürg Lehni
c30ff47930
Remove matrix argument from all hit-testing related methods.
...
We better inverse-transform the point and save the code!
2011-12-25 00:19:01 +01:00
Jürg Lehni
1eadc87b58
No need to calculate matrix before handling cached values.
2011-12-24 12:30:43 +01:00
Jürg Lehni
733d879bb6
Add / improve comments about DOCS.
2011-12-23 22:47:10 +01:00
Jürg Lehni
97b66582f8
Rename Item#applyMatrix() to shorter #apply().
2011-12-23 22:41:05 +01:00
Jürg Lehni
61dca0b4d0
Introduce standard way of passing matrices/points to Item constructors.
2011-12-20 23:33:53 +01:00
Jürg Lehni
f2d7b85616
Introduce Matrix#setIdentity().
2011-12-20 23:14:30 +01:00
Jürg Lehni
a8392fbf68
Implement local caching for the calculation of concatenated global matrices in the drawing of selected items in Project#draw().
2011-12-20 23:09:49 +01:00
Jürg Lehni
8888ca912a
The internal Item#_position is no longer a LinkedPoint.
...
Make sure it stays that way when it's kept up-to-date in Item#transform().
2011-12-20 22:35:06 +01:00
Jürg Lehni
0592038b9f
Remove debugging code that lead to slow-down regressions.
2011-12-20 22:34:08 +01:00
Jürg Lehni
93ede28f3b
Implement new selection drawing mechanism.
...
Using the new Item#globalMatrix.
2011-12-20 11:42:00 +01:00
Jürg Lehni
89a1d2fe73
Define Item#globalMatrix.
...
For now uncached.
2011-12-20 11:39:36 +01:00
Jürg Lehni
4a46c8ac98
Fix recently introduced error with stroke/fillColor handling
...
Since CanvasContext#stroke/fillStyle cannot be set to null, we have to keep checking Style#fill/strokeColor even after calling #_setStyles().
2011-12-19 23:07:14 +01:00
Jürg Lehni
cc26fdc5d1
Optimise handling and setting of fill and stroke styles.
...
Handle setting of fillColor and strokeColor in Item#_setStyles() instead of the various #draw() methods, directly access internal styles instead of using accessor calls and fix PointText#draw().
2011-12-19 22:40:14 +01:00
Jürg Lehni
ea0eaf04ea
Make TextItem#style a reference to #characterStyle.
...
Internally, CharacterStyle extends PathStyle and is now stored in TextItem#_style.
2011-12-19 22:26:09 +01:00
Jürg Lehni
19429d9b6d
Automate generation of style accessors through Style class.
...
Shaving off some byes by adding more magic.
2011-12-19 22:14:10 +01:00
Jürg Lehni
f5c1125709
Move Path#_setStyles() to Item, so it can be used in PointText too.
2011-12-19 21:25:39 +01:00
Jürg Lehni
e89b2e5be1
Remove recursive argument from Item#applyMatrix().
...
Always apply transforms recursively.
2011-12-19 21:20:10 +01:00
Jürg Lehni
4514c63ed4
Merge remote-tracking branch 'origin/master'
2011-12-18 21:30:22 +01:00
Jürg Lehni
e52d2a08b8
Use correct flags in _changed() call.
2011-12-18 16:56:18 +01:00
Jürg Lehni
554047ae38
Expose Item#_getCachedBounds and use it in PlacedSymbol for proper handling of nested matrices.
2011-12-18 16:55:56 +01:00
Jürg Lehni
d2b1c77686
No need to call #getDefinition() internally.
...
Use private value directly.
2011-12-18 16:55:24 +01:00
Jürg Lehni
9e5eb17264
Improve Item#transform() and implement #applyMatrix() to support nested matrices. Work in progress.
2011-12-18 16:54:21 +01:00
Jonathan Puckey
7fdb01cf77
More work on Item event handling documentation.
2011-12-07 12:45:04 +01:00
Jonathan Puckey
1414500f45
First version of documentation of Item event handlers and MouseEvent.
2011-12-01 11:57:10 +01:00
Jürg Lehni
6e5e54cfe6
Change sequence of position / bounds related properties.
2011-11-30 18:36:44 +01:00
Jürg Lehni
f895d3e6fb
Fix recently introduced error in Item#setSelected().
2011-11-30 18:28:11 +01:00
Jürg Lehni
a26bc87686
Implement support for Item#matrix in Item#draw().
2011-11-30 18:19:23 +01:00
Jürg Lehni
a57070e4a3
Fix bounds caching issues on Group.
2011-11-30 18:18:51 +01:00
Jürg Lehni
a3ec184873
Add dontLink argument to Item#getPosition()
...
And use it to optimise up #setPosition().
2011-11-30 18:18:24 +01:00
Jürg Lehni
bb1d436281
Move creation of LinkedRectangle for 'bounds' to bounds accessor.
2011-11-30 17:20:29 +01:00
Jürg Lehni
3ece08bea1
Fix handling of recursion in Item#setSelected() / #setFullySelected().
2011-11-30 17:16:52 +01:00
Jürg Lehni
cf4c2b4919
Move #matrix accessor from PlacedItem to Item.
2011-11-29 17:19:31 +01:00
Jürg Lehni
5ff3a07b31
Add comment about 1px rectangle in Raster#getAverageColor().
2011-11-29 17:19:15 +01:00
Jürg Lehni
b5e46971f0
Replace new Size(x, y) calls with internal Size.create(x, y).
2011-11-29 17:11:15 +01:00
Jürg Lehni
26210fb95b
Implement transforming of cached bounds again, if possible.
2011-11-28 23:20:47 +01:00
Jürg Lehni
cadc2e78ca
We can directly access Item#_id.
...
No need to call Item#getId() internally.
2011-11-28 23:14:02 +01:00
Jürg Lehni
cb8c94ef7e
Recursively call _clearBoundsCache
...
If the cache for an item's children is not valid anymore, that needs to propagate up the DOM tree.
2011-11-28 23:13:31 +01:00
Jürg Lehni
d3c83be3bb
Correct execution sequence in getBounds so that the parent's _boundsCache is kept up to date even when the child is returning a cached result.
2011-11-28 22:59:25 +01:00
Jürg Lehni
e82deff4b9
Fix the drawing of PlacedSymbol bounds when selected.
2011-11-27 14:55:49 +00:00
Jürg Lehni
ac18786109
Implement bounds caching for all items, even groups and layers, using a smart structure keeping track of which items affect the cache, and automatically clearing it on changes without having to walk the DOM tree.
2011-11-27 13:48:15 +00:00
Jürg Lehni
b51cf064b0
Make baseItem to last optional parameter of _getBounds.
2011-11-26 11:55:19 +01:00
Jürg Lehni
a0ad81b576
Pass on the baseItem of a getBounds call, required to implement proper caching later.
2011-11-26 11:24:48 +01:00
Jürg Lehni
8729e9919f
Use getBounds.call(item) to use this instead of item, since we're accessing it a lot.
2011-11-26 10:42:38 +01:00
Jürg Lehni
1fd9242fd8
Define private getBounds() function that handles matrix concatenation, bounds caching and calling of _getBounds, leading to further simplifications in PlacedItem.
2011-11-26 10:39:51 +01:00
Jürg Lehni
2605fadcfd
Move bounds related code to a proper inejction scope, so we can declare private functions for caching.
2011-11-26 10:18:47 +01:00
Jürg Lehni
de4b5a0d87
Start implementing Item#matrix, work in progress.
2011-11-26 10:15:01 +01:00
Jürg Lehni
92066a6ecb
Implement Item#_boundsType as a structure to control bounds handling and caching.
2011-11-24 16:03:05 +01:00
Jürg Lehni
a6b90dea35
Clean up Item documentation.
2011-11-24 16:02:34 +01:00
Jürg Lehni
44b6fe9f0d
Fix documentation about bounds beans.
2011-11-24 15:46:06 +01:00
Jürg Lehni
310fbb260b
Remove _boundsCache and replace it with easier _simpleBounds flag.
2011-11-24 15:44:26 +01:00
Jürg Lehni
067e0a954b
Add comment about LinkedRectangle for 'bounds'.
2011-11-24 15:39:04 +01:00
Jürg Lehni
909b9040d5
Since we only use _createBounds in one place now we can inline it.
2011-11-24 15:38:08 +01:00
Jürg Lehni
569c415b2f
Start implementing bounds caching the new way.
...
Work in progress still.
2011-11-24 15:37:44 +01:00
Jürg Lehni
ea87be166e
Part one of big refactoring of bouding box handling. Functional, but caching is broken right now.
2011-11-24 15:13:21 +01:00
Jürg Lehni
d9777111dc
No need for an injection scope as we can also just use Base.each() in combination with a side-car.
2011-11-24 14:54:04 +01:00
Jürg Lehni
1d6cfeeb9b
Add dest and dontNotifty arguments to Matrix#_transformBounds() and use them where appropriate.
2011-11-24 11:29:35 +01:00
Jürg Lehni
8a53288b1e
Add comment about upcoming changes relating to bounds.
2011-11-23 18:13:21 +01:00
Jürg Lehni
eb70c4de5d
Directly pass matrix argument to _getBounds() instead of whole arguments array.
2011-11-20 18:51:34 +01:00
Jürg Lehni
b9f6c99dcd
Add comments and clean up code.
2011-11-17 19:28:05 +01:00
Jürg Lehni
57bd659023
Move Item base mouse handling code to CanvasView.
2011-11-16 13:12:41 +01:00
Jürg Lehni
c8e1a9c959
Merge remote-tracking branch 'origin/master'
2011-11-12 23:57:39 +01:00
Jürg Lehni
e4586cfeeb
Commit beginning of item based mouse events. So far only onMousedown / 'mousedown' is supported.
2011-11-12 23:57:25 +01:00
Jonathan Puckey
52385451f6
Resolve a few documentation todos.
2011-11-12 18:30:21 +01:00
Jürg Lehni
52ad906c97
Add support for onFrame handlers on Item.
2011-11-12 17:44:05 +01:00
Jürg Lehni
ea689faa43
Fix white space.
2011-11-12 15:50:53 +01:00
Jürg Lehni
07839cf683
Add comment about name being set again in addChild().
2011-11-12 15:50:35 +01:00
Jürg Lehni
24f07dccec
Clean up some JSDoc comments.
2011-11-12 13:27:29 +01:00
Jürg Lehni
b1332331b0
Simplify injection scope for removeOn* methods.
2011-11-12 13:22:45 +01:00
Jürg Lehni
3dfb4d3ae5
Make Item#removeOn() calls work with new event callback mechanism.
2011-11-11 20:41:09 +01:00
Jonathan Puckey
a96a92caba
Add support for hit testing Raster items and getting the color of the pixel that was hit.
2011-11-11 15:00:53 +01:00
Jürg Lehni
af9df0e1b8
Provide point of hit handles and segments too in HitResult.
2011-11-11 14:47:03 +01:00
Jürg Lehni
1124236b8a
Use inject() instead of a each() loop to add values to HitResult, so getters can be defined too (required for raster hit testing).
2011-11-11 13:11:10 +01:00
Jürg Lehni
42d0e722db
Rename RGBColor -> RgbColor, to avoid clash with native constructor, and follow same naming convention for HsbColor and HslColor, but keep references to old names for PaperScript scopes for now.
2011-11-10 19:16:34 +01:00
Jonathan Puckey
eb34e058c0
Fix bug in Item#hitTest and Project#hitTest documentation. Closes #57
2011-11-10 15:14:49 +01:00
Jürg Lehni
6052e94a2a
Add basic code for fine-grained change tracking, as required by on-the fly SVG DOM manipulation.
2011-09-22 10:32:17 +02:00
Jürg Lehni
936fd43c37
Implement Item#layer.
2011-09-18 10:38:16 +02:00
Jürg Lehni
ae116cd043
Improve comments about change notifications.
2011-08-23 16:36:57 +02:00
Jürg Lehni
79f351e5ee
No need to check for _project as it will always bet set.
2011-08-23 16:35:19 +02:00
Jonathan Puckey
0ee1e80c68
Node.js: add Raster support.
2011-08-21 16:38:06 +02:00
Jonathan Puckey
e82a838085
Fix problem in Item#rasterize(resolution) where rasterizing the active layer caused the resulting Raster to be positioned wrongly.
2011-08-08 18:43:45 +02:00
Jürg Lehni
022de4d781
Some documentation fixes for v0.2
2011-08-01 14:25:46 +01:00
Jürg Lehni
31cc571e8a
Docs: Hide matrix parameter in Item#hitTest() and add "options." in front of each options property.
2011-08-01 11:47:42 +01:00
Jürg Lehni
884ea96a29
Docs: Link HitResult back to #hitTest() functions.
2011-08-01 11:47:08 +01:00
Jonathan Puckey
e0650cae73
Document HitResult, Item#hitTest(point, options) and Project#hitTest(point, options).
2011-07-31 22:58:51 +02:00
Jürg Lehni
8eaeb7fb5e
Remove filepp.pl as preprocessor and switch to our own Prepro.js, a simple preprocesssor for JavaScript that speaks JavaScript, written in JavaScript, allowing preprocessing to either happen at build time or compile time.
2011-07-26 10:09:31 +01:00
Jonathan Puckey
8e816f6bfc
HitResult#getOptions: only have fill / stroke / segments options set to true if no options object was provided.
2011-07-15 14:52:38 +02:00
Jonathan Puckey
611d9e3af3
Item#hitTest: ignore top level layers when hit testing for bounds or center.
2011-07-15 13:00:40 +02:00
Jürg Lehni
077a83ca7c
Fix documentation error.
2011-07-11 12:15:34 +02:00
Jürg Lehni
55f815cb72
Remove obsolete TODOs.
2011-07-09 17:12:13 +02:00
Jürg Lehni
615a1281e3
Remove obsolete TODO.
2011-07-09 17:03:10 +02:00
Jürg Lehni
5bac5189a4
Implement Item#fullySelected.
2011-07-09 17:02:58 +02:00
Jürg Lehni
ebd3bfc092
Introduce faster versions of Rectangle#contains() that do not perform checks.
2011-07-09 11:07:12 +02:00
Jürg Lehni
8e6adbc284
Fix documentation.
2011-07-09 09:28:49 +02:00
Jürg Lehni
f958b41d90
Don't filter for a type by default.
2011-07-09 09:28:36 +02:00
Jürg Lehni
b5d3cf2ad0
Add comment about missing documentation.
2011-07-08 23:32:50 +02:00
Jürg Lehni
2dfe4dfa19
Remove invalid comments.
2011-07-08 23:32:38 +02:00
Jürg Lehni
b1a2a626ad
Separate type from name for 'bounds' hit-results.
2011-07-08 23:29:55 +02:00
Jürg Lehni
62ba983432
Implement hit-test options: center and bounds.
2011-07-08 23:26:50 +02:00
Jürg Lehni
c033a5a7bc
Implement hit-test options: segments, handles and ends.
2011-07-08 23:26:21 +02:00
Jürg Lehni
9db96ae898
Perform point conversion along with HitResult.getOptions().
2011-07-08 23:25:27 +02:00
Jürg Lehni
dfbe3135ad
Remove HitResult inheritance from CurveLocation, but have a #location property pointing to it.
2011-07-08 22:25:42 +02:00
Jürg Lehni
a580b23f2a
Reverse direction of child-looping in hit-tests, so items that get drawn last are tested first.
2011-07-08 21:15:16 +02:00
Jürg Lehni
1b3d4773a3
Optimise hit-testing by checking point to lie within #roughBounds + tolerance first.
2011-07-08 21:01:34 +02:00
Jürg Lehni
69a7d0bfd4
Implement a first version of Item#hitTest(), so far working only for Path items. Work in progress.
2011-07-07 22:14:58 +02:00
Jürg Lehni
de87c1f97a
Define a bit of code that names all our class constructors based on the property name under which they were stored, and use that in Item#toString().
2011-07-07 22:14:09 +02:00
Jürg Lehni
3bd6122e82
Begin adding support for guides.
2011-07-07 21:02:52 +02:00
Jürg Lehni
ced45c4e8f
Add HSLColor to documentation.
2011-07-07 20:51:23 +02:00
Jürg Lehni
110cffc14c
Improve comments for bounds functions.
2011-07-04 23:28:28 +02:00
Jürg Lehni
9499125b22
Link Item <-> Symbol#definition <-> PlacedItem and make sure changed events get sent across the whole chain.
2011-07-04 21:27:42 +02:00
Jürg Lehni
1ed6d46ce3
Define Item ids immediately, not on first request.
2011-07-04 20:19:37 +02:00
Jürg Lehni
bfa774f717
Move private bounds methods above the actual beans definitions.
2011-07-04 19:53:29 +02:00
Jürg Lehni
45a3e7f873
Big refactoring of the way bounds are handled and cached, properly supporting Groups inside Symbols, and also adding #roughBounds, to be used by upcoming hit testing code.
2011-07-04 19:45:53 +02:00
Jürg Lehni
10b0062ce2
Minor fixes and clean ups.
2011-07-04 11:54:52 +02:00
Jürg Lehni
7e26a7af1e
Rename all x-axis / y-axis parameters in #scale and #shear to hor / ver, and fix a bug in Matrix#shear, where an undeclared variable was used (sx instead of shx).
2011-07-01 18:00:16 +02:00
Jürg Lehni
aa9be1d9c5
Rename #controlBounds -> #handleBounds, to reflect terminology used elsewhere.
2011-07-01 17:23:10 +02:00
Jürg Lehni
9fa51a0457
Implement Item#controlBounds and Path#controlBounds, and test it in StrokeBounds example. This is a first step towards fast hit-testing.
2011-07-01 12:51:18 +02:00
Jürg Lehni
79c0ad8cc5
Update copyright notices.
2011-07-01 12:17:45 +02:00
Jürg Lehni
d95480bc22
Remove trailing white spaces.
2011-07-01 12:01:32 +02:00
Jürg Lehni
609f23c64d
Make PlacedItem#matrix private and add getter / setter for it.
2011-07-01 11:32:09 +02:00
Jürg Lehni
1cd7165ea2
Define PlacedItem as base class for Raster and PlacedSymbol.
2011-07-01 11:26:51 +02:00
Richard D. Worth
ac39873693
Whitespace. Removed all trailing whitespace from .js files
2011-06-30 06:01:51 -04:00
Jürg Lehni
4c6e152748
Move Item#setBounds() close to #getBounds() and document #_getBounds().
2011-06-30 08:53:57 +02:00
Jürg Lehni
cca562efc0
Prepare Item#_getBounds() for #controlBounds.
2011-06-30 08:51:53 +02:00
Jürg Lehni
7cd749e63d
Change all documentation to new convention of defining @class outside injection scope, fix some comments and a few errors with examples.
2011-06-22 23:56:05 +01:00
Jonathan Puckey
a17dc4171a
Fix bug where cloned items that were selected weren't appearing in the Project#selectedItems array.
2011-06-21 01:52:44 +02:00
Jürg Lehni
3aff54517e
Add support for ChangeFlag notifications to Raster.
2011-06-20 20:13:24 +01:00
Jürg Lehni
ea9eacf578
Fix value of ChangeFlag.CLIPPING
2011-06-20 20:07:04 +01:00
Jürg Lehni
4c20b1ef3d
Support rotations by multiples of 90 degrees too, as they can be applied correctly to rectangles.
2011-06-20 19:52:22 +01:00
Jürg Lehni
5e524a478e
We need to process _bounds and _position outside of _transform() handling, since items without _transform() can still have cached values, e.g. Group.
2011-06-20 19:33:34 +01:00
Jürg Lehni
22736dc72d
Clean up code.
2011-06-20 19:32:42 +01:00
Jürg Lehni
bc567f4d29
Improve shear() parameter naming.
2011-06-20 19:20:51 +01:00
Jürg Lehni
5e39e60d51
Fix typo.
2011-06-20 18:34:51 +01:00
Jürg Lehni
5b85d78faa
Use Matrix#getRotation() to decide if we can transform cached _bounds and _position for perforamce improvements.
2011-06-20 18:25:49 +01:00
Jürg Lehni
37f5a64dce
Improve _bounds handling by introducing Item#_createBounds() that always uses LinkedRectangle class.
2011-06-20 17:34:43 +01:00
Jürg Lehni
8b66c4fa83
Remove flags parameter in Item#transform() for now.
2011-06-20 17:03:43 +01:00
Jürg Lehni
4e3aa3e5c5
Move all Style classes into their own folder.
2011-06-20 16:38:01 +01:00
Jürg Lehni
456bf7f2a9
Move more getter / setter injection functionality from PathStyle to Style, to be shared among all Style classes.
2011-06-20 15:21:42 +01:00
Jürg Lehni
a7e57ada88
Big refactoring of the way Style objects are linked to their owning classes, implemented in a way that works across all sub classes.
2011-06-20 14:58:48 +01:00
Jürg Lehni
a45340d20f
Revert previous change since arguments.length is wrong when parameters are undefined when using Function#call.
2011-06-20 14:37:09 +01:00
Jürg Lehni
5ce49e6f8f
Merge remote-tracking branch 'origin/master'
2011-06-20 14:26:05 +01:00
Jürg Lehni
2c68e7e58f
Use faster Function#call() when arguments are clear.
2011-06-20 14:25:27 +01:00
Jonathan Puckey
e23282fe05
Documentation: convert Array return types to Type[].
2011-06-20 15:19:08 +02:00
Jürg Lehni
55724b0e29
Move defaults handling fully to Style base class.
2011-06-20 14:10:37 +01:00
Jürg Lehni
f064886c67
Introduce Style as a base class for all Style classes, and move the definition of create() there.
2011-06-20 13:56:49 +01:00
Jürg Lehni
3a232b305e
Implement _changed() mechanism in Color, by having Colors know which items they are defining styles for, through an internal _owners list.
2011-06-20 00:00:02 +01:00
Jürg Lehni
af0e5a07b7
Add getter/setter for TextItem#content and use Change.CONTENT to notify of changes.
2011-06-19 23:28:41 +01:00
Jürg Lehni
596cc8f83b
Implement #_needsRedraw() mechanism in PaperScope and Project, to notify Views of redraws required by changes in appearance.
2011-06-19 23:03:18 +01:00
Jürg Lehni
7a90f9260e
Have subclasses of Item call the base version of _changed().
2011-06-19 22:40:49 +01:00
Jürg Lehni
a50f6a23ac
Add comment.
2011-06-19 22:36:41 +01:00
Jürg Lehni
2b63aefc09
Add ChangeFlag.CLIPPING and use it for proper clip mask caching in Group.
2011-06-19 22:36:04 +01:00
Jürg Lehni
0df909dd71
Rename ChangeFlags -> ChangeFlag.
2011-06-19 22:21:14 +01:00
Jürg Lehni
f0bc3f115b
Have all visual changes include ChangeFlags.APPEARANCE.
2011-06-19 22:20:28 +01:00
Jürg Lehni
bfe229ae14
Use #addChildren() instead of #setChildren() in Group constructor.
2011-06-19 22:05:31 +01:00
Jürg Lehni
2594a41b7d
Remove the mention of optional parameters in documentation, as they are marked optional already.
2011-06-19 21:52:52 +01:00
Jürg Lehni
1e436b2980
Use typed array in documentation.
2011-06-19 21:50:10 +01:00
Jürg Lehni
cb61e8d452
Implement rest of ChangeFlags.HIERARCHY notifications.
2011-06-19 21:49:26 +01:00
Jürg Lehni
fe7c618deb
Define Item#addChildren() / #insertChildren() and adjust documentation a bit.
2011-06-19 21:48:36 +01:00
Jürg Lehni
bf627d9d9c
Remove all beans: true settings.
2011-06-19 18:54:41 +01:00
Jürg Lehni
7d2f10f22b
Rename private move() -> insert(), to reflect recent name changes.
2011-06-19 18:50:23 +01:00
Jürg Lehni
bbcec27031
Move support for _bounds caching to Item and start using it in PlacedSymbol.
2011-06-19 18:07:53 +01:00