Jürg Lehni
9501fd1924
Make hit-test tolerance dependent of view#matrix
2013-12-10 22:53:03 +01:00
Jürg Lehni
7c28c7e9e3
Do not factor in view matrix into Item#globalMatrix.
...
Instead concatenate it when drawing selections.
2013-12-10 13:18:21 +01:00
Jürg Lehni
e238d23194
Implement caching of internal, untransformed bounds.
2013-12-09 10:53:19 +01:00
Jürg Lehni
81fe98d1bb
Make cachedBounds mechanism work for Symbols.
2013-12-09 09:05:29 +01:00
Jürg Lehni
2cd3de8188
Improve versioning of _globalMatrix
2013-12-09 07:51:28 +01:00
Jürg Lehni
97fcd6ff38
Implement Item#getGlobalMatrix(), #globalToLocal() and #localToGlobal()
...
Closes #270 .
2013-12-08 20:04:10 +01:00
Jürg Lehni
afe00add32
Implement option.type filtering in #hitTest() functions.
2013-12-08 16:32:42 +01:00
Jürg Lehni
593e0d8d7f
Remove Base.merge() and use a new Straps.js feature instead.
...
A more clever Base() constructor that allows merging.
2013-11-28 22:20:00 +01:00
Jürg Lehni
da9e1f8de7
Define Project#isEmpty()
2013-11-24 22:53:41 +01:00
Jürg Lehni
af4410953f
Various clean-ups regarding the handling of activeLayer, JSON deserialization, DOM insertion and and layer reusing.
...
JSON deserialization does no longer insert items into DOM twice now, and should therefore be faster.
2013-11-24 16:25:13 +01:00
Jürg Lehni
5439f6ba45
We need to take pixel ratio into account when directly blitting blend-modes onto canvas.
2013-11-06 13:11:54 +01:00
Jürg Lehni
2a9fe48cc9
Add options.matchShapes support to #exportSVG and improve documentation of various import / export functions.
2013-10-30 16:18:59 +01:00
Jürg Lehni
5d7c7a2409
Improve documentation of #hitTest()
2013-10-30 16:18:15 +01:00
Jürg Lehni
b86b66d43d
Improve documentation.
2013-10-29 19:25:10 +01:00
Jürg Lehni
b2188be567
Make sure _globalMatrix is not set to false values in Item#rasterize().
2013-10-29 17:37:45 +01:00
Jürg Lehni
5a462f42b7
Improve some comments / docs.
2013-10-29 09:42:59 +01:00
Jürg Lehni
160fe25cd1
Improve documentation of #importSVG() methods.
2013-10-29 09:42:58 +01:00
Jürg Lehni
b4651a18c6
Implement #getItem() on Project and Item, similar to #getItems() but returning only the first match.
2013-10-19 13:02:53 +02:00
Jürg Lehni
4fb6a5d949
Implement #getItems(match) on Project and Item as a simple and efficient query interface.
2013-10-19 12:27:13 +02:00
Jürg Lehni
0b7e128426
Only rely on _drawCount for drawing related things, and caching where it allows.
...
Project#selectedItems was out of sync until the next draw loop.
2013-10-18 21:52:22 +02:00
Jürg Lehni
19c7788617
Fix documentation irregularities.
2013-08-23 19:45:28 -07:00
Jürg Lehni
aa4d990c90
Move and unify handling of Item#_set(props) to new Item#_initialize(), and add support for props.insert = false.
2013-07-21 15:45:22 -07:00
Jürg Lehni
20a17f2939
Implement insert parameter in Item#clone() to control DOM insertion.
...
Defaults to true. Also insert in the right place now, above the original.
2013-07-19 18:27:00 -07:00
Jürg Lehni
fdfb7abe58
Update exportSVG() documentation.
2013-06-27 18:14:51 -07:00
Jürg Lehni
41746d2d25
Docs: Write documentation for #import/export JSON/SVG, for both Item and Project.
2013-06-27 18:03:49 -07:00
Jürg Lehni
a4535edbb9
Bring back _class names, since code minification breaks reliance on constructor.name.
...
Closes #248 .
2013-06-23 20:18:32 -07:00
Chris Barmonde
68626ca62b
Fix project.clear() so it removes all layers properly.
2013-06-20 20:14:47 -06: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
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
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
f0f7a7f35c
Explain compact = true in Project#_serialize()
2013-05-28 07:57:35 -07:00
Jürg Lehni
0b4bc678bc
Properly fix issue with Project#exportJSON() creating separate projects on import.
2013-05-28 07:42:38 -07:00
Jürg Lehni
0f74c01f75
Make sure project we import into is active.
2013-05-27 23:48:16 -07:00
Jürg Lehni
85920bbdb8
Unbox project data in Project#importJSON(), as we don't want to create a new project object.
2013-05-27 23:43:24 -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
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
7f00ef8f05
Fix white-spaces.
2013-05-24 22:25:22 -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
1b61e4333c
Implement Project#clear().
2013-04-22 22:48:36 -07:00
Jürg Lehni
6800a6d534
Use separate id ranges for different classes.
2013-04-22 19:09:59 -07:00
Jürg Lehni
3025c63179
Simplify Style creation.
2013-04-19 20:00:30 -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
2e265693ff
Make #drawSelected() protected.
2013-04-18 17:50:53 -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
0f19e72733
Minor tweaks.
2013-04-09 19:12:47 -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