Commit graph

1267 commits

Author SHA1 Message Date
Jürg Lehni
e8390a76d8 Define Path#toShape() and Shape#toPath() as aliases to #clone(). 2016-01-09 12:08:47 +01:00
Jürg Lehni
f2ae7840cf A lot of work on documentation.
- @values lists
- Improve event documentation
- Compound path
- etc.
2016-01-08 20:45:54 +01:00
Jürg Lehni
93ba42259b Fix the way multiple children with the same name are handled. 2016-01-08 16:42:41 +01:00
Jürg Lehni
7969e4647c Use shadowBlur instead of shadowColor to clear shadows after fills. 2016-01-07 22:06:10 +01:00
Jürg Lehni
86b9d04c43 Rename from, to parameters to start, end in methods where the end is exclusive.
Relates to #338
2016-01-07 11:29:36 +01:00
Jürg Lehni
2539527864 Fix minification warnings. 2016-01-06 15:25:37 +01:00
Jürg Lehni
b9c76f44e8 Convert "Note: " comments to "NOTE: " and do some cleanup. 2016-01-06 14:23:19 +01:00
Jürg Lehni
5a16d0cd01 Implement proper handling of self-touching paths in resolveCrossings().
Closes #874, #887
2016-01-06 10:53:50 +01:00
Jürg Lehni
a1fcaabed6 Implement item comparison through rasterization and resemble.js diffing, directly integrated into QUnit.
And start using it for boolean operation unit tests.
2015-12-30 21:55:21 +01:00
Jürg Lehni
2596b81616 Add optional insert parameter to #rasterize() 2015-12-30 21:55:21 +01:00
Jürg Lehni
62a23662fa Unify handling of insert parameters. 2015-12-30 21:55:21 +01:00
Jürg Lehni
44f98ee094 Replace all mention of DOM in the documentation with scene graph. 2015-12-30 21:55:21 +01:00
Jürg Lehni
c0a2e0ec63 Support insert parameter again in #toShape() / #toPath() 2015-12-30 21:55:21 +01:00
Jürg Lehni
0e427c16a2 Fix some white-spaces in comments and HTML. 2015-12-30 21:55:20 +01:00
Jürg Lehni
4d13f0e1e0 Simple optimization in PathItem#contains()
Perform a handle bounds check before calculating winding, as described by @iconexperience in #869
2015-12-30 21:55:20 +01:00
Jürg Lehni
5c976420f8 Further improve #resolveCrossings() based on discussion with @iconexperience.
Closes #869
2015-12-30 21:55:20 +01:00
Jürg Lehni
f34afbc19a Clean up code from #856 a bit. 2015-12-30 21:55:19 +01:00
Jürg Lehni
a7a07fb6d5 Update JSDoc and do some documentation spring-cleaning.
- Convert from {@code ...} to shorter `...`
- Reformat some documentation comment blocks
- Update copyright notices
2015-12-30 21:55:19 +01:00
Jürg Lehni
b724a59901 Handle non-reversible matrix in Item#hitTest()
Closes #617
2015-12-30 21:55:18 +01:00
Jürg Lehni
f2f34c3b75 Some minor fixes in new #getItems() code. 2015-12-30 21:55:18 +01:00
Jürg Lehni
de532aac2f Implement control over recursive iteration in #getItems()
Closes #853.
2015-12-30 21:55:18 +01:00
Jürg Lehni
f95d6ab310 Fix bug in Item#getItems(function() {})
Closes #751
2015-12-30 21:55:18 +01:00
Jürg Lehni
08d75a48ff Fix issue again with param.overlapping in #getItems()
This time, properly!
Closes #751
2015-12-30 21:55:18 +01:00
Jürg Lehni
aa316ffc8c Avoid applying item._matrix twice in Item#intersects()
As suggested by @sapics.
Closes #847
2015-12-30 21:55:18 +01:00
Jürg Lehni
306d8bae86 Clean up the new Item#reduce() code a bit. 2015-12-30 21:55:18 +01:00
Jürg Lehni
fec67617e1 Merge pull request #846 from iconexperience/reduce-fix
Make sure reduced item has no parent if original item had no parent.
Fix for #835
2015-12-30 21:55:18 +01:00
Jürg Lehni
b987590c71 Define documentation for excludeMatrix parameter. 2015-12-30 21:55:18 +01:00
Jürg Lehni
83b53cb9e0 Fix a few edge cases in cloning and copying of attributes. 2015-12-30 21:55:17 +01:00
Jürg Lehni
2fea40f86f Introduce new Item#copyAttributes() & #copyContent(), and revamp #clone() handling. 2015-12-30 21:55:17 +01:00
Jürg Lehni
a5f05c90f5 Rename #windingRule to #fillRule.
...keeping deprecated aliases on Style and Item around for now.

Closes #858
2015-12-30 21:55:17 +01:00
Jürg Lehni
0badb3b3f4 A bunch of code clean-ups. 2015-12-30 21:55:16 +01:00
sapics
81a4d142f0 Fix shape.strokeBounds with strokeScaling is false 2015-12-30 21:52:34 +01:00
sapics
9c1c00c11e Minor minification 2015-12-30 21:52:34 +01:00
Jürg Lehni
1e72447a7d Minor comment change. 2015-11-12 10:12:46 +01:00
Jürg Lehni
8149fa830b Only rasterize an item's content if the resulting raster is not empty.
closes #828
2015-11-12 10:11:31 +01:00
Jürg Lehni
8eb0dcc87d Fix various JS linting problems. 2015-10-27 23:35:30 +01:00
sapics
502558a321 Fix variable leaks 2015-10-23 09:45:39 +09:00
Jürg Lehni
3314668a0c Streamline mouse event handling between View and Item.
Consolidating code and making View#onMouseDown/Up/Move/... events work.
2015-10-14 16:25:36 +02:00
Jürg Lehni
e36319b71a Give PathItem#getIntersections() a way to filter found intersections right away.
And use it in #getCrossings()
2015-09-21 10:41:59 -04:00
Jürg Lehni
ae93652b56 Clean up getIntersection() methods.
Now that they filter the results on the fly.
2015-09-18 17:31:23 +02:00
Jürg Lehni
71a7cc37e6 Many documentation clean-ups. 2015-09-06 17:20:01 +02:00
Jürg Lehni
b52d343527 Use same notation for all injection scopes. 2015-09-06 16:48:23 +02:00
Jürg Lehni
cf813faa75 Remove all mention of points and square points as units.
And some other doc clean-ups.
2015-09-06 16:37:10 +02:00
Jürg Lehni
31771aa01d Insert results of boolean operations above whichever of the two paths appear further up in the stack. 2015-08-30 14:47:46 +02:00
Jürg Lehni
fd1f2e56f8 Optimize Item#intersects() by only checking to see if there are at least one intersection. 2015-08-25 11:45:28 +02:00
Jürg Lehni
af24af8916 Merge pull request #730 from sapics/raster.toDataURL
add param to raster.todataurl
2015-08-21 17:41:32 +02:00
Jürg Lehni
13b5e6ce22 Help JS minification. 2015-08-21 15:15:06 +02:00
Jürg Lehni
4cdc572824 Merge pull request #729 from sapics/item-matrix
setMatrix of item makes more useful
2015-08-21 15:11:49 +02:00
Jürg Lehni
3dd0f1fc1b Introduce new option in SVGExport to not embed images.
Closes #696
2015-08-20 19:34:38 +02:00
Jürg Lehni
650bf5d616 Implement CORS support on Raster.
Closes #754
2015-08-20 19:14:33 +02:00
Jürg Lehni
2366e03265 Implement getItems(function() {}).
As requested in #751.
2015-08-19 01:04:47 +02:00
Jürg Lehni
39ea409684 Fix issue with param.overlapping in #getItems()
Consider items fully contained inside the rectangle as overlapping as well.

Closes #751.
2015-08-19 00:55:44 +02:00
Jürg Lehni
98edddc5ac Include _pivot in cloning.
Closes #747
2015-08-17 14:47:56 +02:00
Jürg Lehni
65f085cc98 Have option.matchShapes control conversion to SVG polygon elements as well.
Closes #753
2015-08-17 14:18:22 +02:00
Jürg Lehni
ffb3ea8d15 Fix wrong URL in documentation. 2015-07-27 12:15:01 +02:00
Jürg Lehni
59b7da0ed5 Fall back to pixelRatio 1 when none is defined.
Required in Item#rasterize() for non-native blend modes. This broke phantomjs tests.
2015-07-27 09:56:37 +02:00
Jürg Lehni
cce42bc6f2 Filter out project key in object literal constructor.
It was causing issues when running test suites in phantomjs.
2015-07-26 14:01:00 +02:00
sapics
d99b2be49a add param to raster.todataurl 2015-07-14 10:17:20 +09:00
sapics
da2caa999e item.setMatrix useful 2015-07-11 18:31:03 +09:00
sapics
d7a4dd2780 rect -> rectangle 2015-07-03 10:00:57 +09:00
Jürg Lehni
708e8d7834 Include documentation about importSVG() onLoad callbacks.
See #715.
2015-06-23 09:40:11 +02:00
Jürg Lehni
4fde7ab37d Add applyMatrix option to importSVG() 2015-06-16 17:52:34 +02:00
Jürg Lehni
b541088c6f A whole lot of documentation clean-up. 2015-06-16 17:50:37 +02:00
Jürg Lehni
2cf6cd7a14 Correctly clone all attributes in Shape#toPath() and Path#toShape()
Also write documentation for both methods.
Closes #622.
2015-06-16 14:30:40 +02:00
Jürg Lehni
ba12eec7f5 Some documentation clean-up.
- Prefer @return over @returns
- Place @see at the end, before @example
2015-06-16 14:08:34 +02:00
Jürg Lehni
c7281ee619 Properly handle bounds caching when items are empty first.
Closes #676.
2015-06-15 19:04:15 +02:00
Jürg Lehni
6ec34fbb60 Replace Lenna with Marilyn. 2015-05-31 10:50:04 +02:00
Jürg Lehni
27bb8a356f Implement unique ids, and fix issue with Base.deserialize()
Gradient and Symbol were overriding each other in the dictionary, and dictionary entries could not contain references to other dictionary entries.

Closes #690
2015-05-11 19:39:39 +02:00
Jürg Lehni
8e7829db5e Remove obsolete comment about hitTest options merge 2015-04-12 15:07:26 +02:00
Jürg Lehni
48bc34b21f Filter out deserialized dictionary in Base.deserialize()
Closes #637
2015-02-28 19:03:03 +01:00
Jürg Lehni
3b47d7ee89 Only draw Raster items when they're fully loaded.
Closes #645.
2015-02-28 18:30:23 +01:00
Jürg Lehni
7c2492ac2a Docs: Improve Item#applyMatrix. 2015-02-26 13:38:29 +01:00
Jürg Lehni
3c31c0e482 Have SVGImport respect the current PaperScope's applyMatrix setting. 2015-01-02 14:19:17 +01:00
Jürg Lehni
66c67fbe94 Improve insertion handling for Item and Layer so insertAbove() / insertBelow() works for Layers too.
Closes #603
2014-12-29 23:16:13 +01:00
Jürg Lehni
16105067bf Correctly handle Item#insertChild(null) 2014-12-28 18:29:20 +01:00
Jürg Lehni
a307bc4d14 Implement recursively parameter in Matrix#apply(), so matrices can be backed in recursively in children too. 2014-12-28 18:29:04 +01:00
Jürg Lehni
80e64ad0a9 Implement setters for Raster#width and #height, and properly handle these values being set in constructors, along with #size.
Closes #557.
2014-12-28 18:27:32 +01:00
Jürg Lehni
c48f4d772e Expose #className on all classes that define #_class
Closes #576
2014-11-30 11:13:51 -08:00
Jürg Lehni
19a9976939 Return emitter in #on(), #off(), #once(), so calls can be chained. 2014-11-18 14:56:55 -08:00
Jürg Lehni
0fb7e49248 Return a LinkedPoint from Item#scaling.
Closes #544,
2014-11-09 07:46:45 -08:00
Jürg Lehni
a39eea64e9 Improve docs sequence a bit. 2014-10-20 23:55:24 +02:00
Jürg Lehni
6e9ff38c15 Fix spelling mistakes in docs. 2014-10-20 23:45:33 +02:00
Jürg Lehni
e7707cd354 Implement match.inside and match.overlapping in #getItems(match).
Closes #275
2014-10-20 23:35:47 +02:00
Jürg Lehni
99ef521af4 Switch from inline @option tags to real doc tags. 2014-10-20 23:33:28 +02:00
Jürg Lehni
c25548031b Clean up documentation for Project#getItems() / Item#getItems(). 2014-10-20 22:44:15 +02:00
Jürg Lehni
82b988327d Update docs to use the newly introduced {@option} tag to docuemnt option-style objects. 2014-10-20 22:41:45 +02:00
Jürg Lehni
782bde238c Find a more general implementation for Item#intersects(item). 2014-10-20 18:00:07 +02:00
Jürg Lehni
5ddbc5b07f Implement Item#intersects(item) 2014-10-20 17:00:18 +02:00
Jürg Lehni
4eb06f0849 Implement Item#isInside(rect). 2014-10-20 16:51:28 +02:00
Jürg Lehni
ad50e9f604 Change the way the optional matrix argument is handled in bounds getters.
Before it was treated as the paren't matrix and the child's was concatenated to it, but it's more logical and useful to just use it as the full replacement matrix instead.
2014-10-20 16:50:33 +02:00
Jürg Lehni
616e848376 Implement handling of empty and editable in #getItems(), and simplify code a bit. 2014-10-18 14:32:21 +02:00
Jürg Lehni
e7fd751765 Fix docs issues with Item#matches() 2014-10-18 13:40:36 +02:00
Jürg Lehni
be82af9b47 Implement Item#matches(name, compare), along with Item#matches(match). 2014-10-15 15:09:44 +02:00
Jürg Lehni
77f6e68846 Remove documentation for deprecated #attach() methods. 2014-10-15 13:01:59 +02:00
Jürg Lehni
3b2a82047e Clean up event related comments, to reflect recent renaming. 2014-10-08 18:33:17 +02:00
Jürg Lehni
c7c49d4091 Time to go with the flow and use the on()/off()/emit() pattern for events. 2014-10-08 14:57:56 +02:00
Jürg Lehni
3dc5c94e25 Rename Callback mix-in to Emitter. 2014-10-08 14:13:08 +02:00
Jürg Lehni
2c9e15b070 Clean up comments. 2014-09-27 22:53:00 +02:00
Jürg Lehni
c87ce4de4c Implement Item#replaceWith(item)
Closes #454
2014-09-27 22:52:37 +02:00
Jürg Lehni
91539e6bc5 Commit changes forgotten in 6450430b68 2014-09-27 22:51:22 +02:00
Jürg Lehni
6450430b68 Implement new strategy regarding Project#activeLayer:
- By default, no layer is created for any project.
- Project#activeLayer is a getter for the hidden #_activeLayer property. When it is called and no layer exists, one is created on the fly.
- Creating any other items creates a layer if none exists (was already the case).
2014-09-27 22:31:49 +02:00
Jürg Lehni
8b4f59962e Allow better code compression by removing repeated variable access on this. 2014-09-27 22:00:46 +02:00
Jürg Lehni
762113230a Implement Item#parentToLocal() and #localToParent()
As outlined in #530
2014-09-25 17:53:08 +02:00
Jürg Lehni
7d69ef1864 Fix documentation of bean properties that are not read-only.
@bean can only be used when the property is read-only or both getters and setters are present in the scope.
2014-08-26 10:01:30 +02:00
Jürg Lehni
6b4f728a72 Bring back support for paper.setup('id') again, and document it properly.
Closes #510.
2014-08-20 16:53:31 +02:00
Jürg Lehni
48cb05a181 Replace tabs with 4 white-spaces. 2014-08-16 19:24:54 +02:00
Jürg Lehni
3ac9a4f369 Use local parent short-cut variable. 2014-08-15 15:38:28 +02:00
Jürg Lehni
c90a7c9f38 Only use the unmerged setting for #strokeScaling, as otherwise it'll be used on layers and groups already.
Closes #500
2014-07-29 23:39:51 +02:00
Jürg Lehni
12254f5fe8 Fix two documentation errors in Raster.
Closes #495
2014-07-26 12:07:36 +02:00
Jürg Lehni
56704b9206 Fix a bug in Item#_removeNamed() for items without parents.
Closes #490.
2014-07-25 21:08:14 +02:00
Jürg Lehni
d3d9e4bada Improve some injection blocks. 2014-07-25 20:05:26 +02:00
Jürg Lehni
3093a8ec43 Introduce matrix.chain(mx) as a shortcut to Matrix.clone().concatenate(mx)
Simplifies quite a few lines of code.
2014-07-08 15:43:17 +02:00
Jürg Lehni
66360bf58a Fix minor documentation bug. 2014-07-08 15:43:17 +02:00
Jürg Lehni
5384a63238 Improve Item. _clearBoundsCache() fix. 2014-05-15 21:33:30 +02:00
Jürg Lehni
a7f57315a6 Fix Item._clearBoundsCache() recursion, correctly this time. 2014-05-15 21:30:06 +02:00
Jürg Lehni
a1c1fc8ed8 Fix an issue in _clearBoundsCache where circular recursion could happen in certain circumstances. 2014-05-15 21:24:09 +02:00
Jürg Lehni
f39b7603de Remove pixelRatio handling from CanvasProvider and move it to Item#draw() 2014-05-15 17:14:37 +02:00
Jürg Lehni
af5e1609dd Fix an issue where CompoundPath wouldn't draw correctly if children had styles that forced non-direct compositing. 2014-05-15 17:09:58 +02:00
Jürg Lehni
c0a911d3c7 Rename Raster#ppi to#resolution, and deprecate #ppi. 2014-05-15 15:36:24 +02:00
Jürg Lehni
9d7ec13724 Update prepro.js to version that can evaluate whole expressions, and fix a newly introduced issue with it. 2014-05-14 15:14:03 +02:00
Jürg Lehni
aac98f2b25 Some code clean-up. 2014-05-13 13:54:31 +02:00
Jürg Lehni
6896535663 Bring back accidentally removed ctx.beginPath(); 2014-05-13 13:51:09 +02:00
Jürg Lehni
846c806034 Implement non-scaling strokes through Style#strokeScaling.
Closes #418.
2014-05-13 13:38:51 +02:00
Jürg Lehni
e1ed7f3294 Prevent drawing selected compound path children twice. 2014-05-12 18:57:09 +02:00
Jürg Lehni
6aaeb81869 Simplify Item#_isUpdate() code a bit. 2014-05-07 17:27:53 +01:00
Jürg Lehni
bb6e1e686f Improve some comments. 2014-05-07 17:22:25 +01:00
Jürg Lehni
56389a3929 Make sure _updateVersion also works for items and children of items with opacity == 0.
Closes #469.
2014-05-07 16:57:39 +01:00
Jürg Lehni
312e670b22 Update Item#_updateVersion in Item#draw() before bailing out when items are invisible.
Closes #469.
2014-05-05 20:13:36 +02:00
Jürg Lehni
8317aacc1b Split Item#hitTest() into separate private function that does need to do arguments reading, for improved performance also when iterating over children. 2014-04-29 20:06:48 +02:00
Jürg Lehni
fce31599a5 Use _dontMerge for #getSelectedColor() on both item and layer, and have style getters on item pass on _dontMerge to the style object. 2014-04-29 19:40:46 +02:00
Jürg Lehni
bd07305435 Move selection drawing code to separate function and fix slowdowns in determining of selection color.
Closes #466 & #464.
2014-04-29 18:52:33 +02:00
Jonathan Puckey
1d905f5c58 Path: add docs for Style Tests group and move Path#isInserted() to Hierarchy Tests group. 2014-04-28 18:41:40 +02:00
Jonathan Puckey
ba98c91509 Fix SVGElement parameter type in docs. 2014-04-28 18:23:14 +02:00
Jürg Lehni
e851090c81 Fix bug in item object literal constructor when providing parent as property after other values that depend on hierarchy being defined already. 2014-04-28 15:12:55 +02:00
Jürg Lehni
42945825e8 Fix all argument assignment TODOs. 2014-04-28 14:22:50 +02:00
Jonathan Puckey
af84a52af8 Move around Item#isInserted() code so it shows up in the Tests group section in the docs. 2014-04-27 23:59:01 +02:00
Jonathan Puckey
12d7756892 Add more matching docs. 2014-04-27 23:40:43 +02:00
Jürg Lehni
9ccba17fbe Clean up white-space, comments and jshint errors. 2014-04-14 18:29:26 +02:00
Jürg Lehni
d0d4b29856 Fix bugs in bounds caching algorithm. 2014-04-13 18:31:01 +02:00
Jürg Lehni
6af797bbad Optimize handling of property object in Item constructor.
Only check for values if it is a plain object, and avoid inserting into DOM twice if parent is specified.
2014-04-13 18:12:19 +02:00
Jürg Lehni
ee729622e0 Correctly handle Raster#setImage(null) 2014-04-13 18:11:34 +02:00
Jürg Lehni
ea81df6572 Fix spelling mistakes. 2014-04-13 17:03:44 +02:00
Jürg Lehni
db2bdf84af Allow the JS optimizer to better do its thing by creating local references to repeatedly used class variables. 2014-04-13 16:44:49 +02:00
Jürg Lehni
397c81e060 Switch from options.type to options.class in Item#hitTest(), to reflect recent change in Item#getItems(). 2014-04-13 16:43:20 +02:00
Jürg Lehni
a931a2530c Implement options.curvesoption for hit-testing curves regardless of stroke settings. 2014-04-11 14:57:58 +02:00
Jürg Lehni
1f7cb30fa5 Correctly transform Item#pivot when #matrix is applied to an item's contents.
Closes #452 and defines unit tests to cover this bug.
2014-04-11 13:18:27 +02:00
Jürg Lehni
eea4e533a4 Support type: Class filters in hit-testing code too. 2014-04-10 22:27:03 +02:00
Jürg Lehni
61c2b11938 Serialize #applyMatrix before #matrix, because in deserialization its setting will affect how #matrix is read.
Closes #451.
2014-04-09 11:57:25 +02:00
Jürg Lehni
60f6eca6c4 Do not keep the view's matrix baked into _globalMatrix, since we might allow multiple views soon. 2014-04-07 17:35:17 +02:00
Jürg Lehni
f002c633a7 Remove trailing white spaces and ensure newlines at the end. 2014-04-06 13:48:03 +02:00
Jürg Lehni
09d0f5f389 Correctly handle paths with only one segment in hit-testing code.
Closes #430.
2014-04-04 12:08:20 +02:00
Jürg Lehni
c0d11ea98e Fix hit-testing of PlacedSymbols.
Closes #428
2014-04-03 09:21:12 +02:00
Jürg Lehni
ee7c604ec0 Remove unused matrix parameter in PlacedSymbol#_hitTest() 2014-04-03 09:19:36 +02:00
Jürg Lehni
748256abb9 Fix broken documentation for Item. 2014-04-02 21:04:39 +02:00
Jürg Lehni
59da291d54 Remove tabs in examples in favor of 4 spaces.
To remove all these annoying JSHint complaints.
2014-04-02 21:03:35 +02:00
Jürg Lehni
fa9786b344 Switch to new simpler convention for control of beans creation in straps.js 2014-04-02 20:53:18 +02:00
Jürg Lehni
4d52867b4a Fix spelling mistakes and white-spaces. 2014-04-02 20:52:13 +02:00
Jürg Lehni
0dca10d192 Take view#matrix into account when calculating and handling global matrices.
But make sure Item#globalMatrix returns a transformation without View#matrix factored in. Closes #440.
2014-03-31 19:28:00 +02:00
Jürg Lehni
e0120b8f58 Fix spelling mistakes. 2014-03-31 18:13:54 +02:00
Jürg Lehni
92331a62c3 transformations will always be defined at this point of the code. 2014-03-31 18:13:36 +02:00
Jonathan Puckey
400bc69159 Remove unnecessary commas.
Found using jscritic.com.
2014-03-28 14:02:39 +01:00
Jonathan Puckey
01dbfe705c Fix accidental leaking of variables to the global scope.
Found using jscritic.com
2014-03-28 13:46:51 +01:00
Jürg Lehni
7233c82084 Fix wrong call of _clearBoundsCache() on child.
Closes #426.
2014-03-20 17:20:26 +01:00
Jürg Lehni
aeeba4d58d Implement ChangeFlag.INSERTION notification to know when an item was inserted in a new parent inside the DOM. 2014-03-18 15:28:29 +01:00
Jürg Lehni
946e0d5b2c Fix spelling mistakes. 2014-03-18 15:25:25 +01:00
Jürg Lehni
e998083156 Rename Shape#shape to Shape#type. 2014-03-18 12:47:54 +01:00
Jürg Lehni
09d90a21bc Support legacy #type filtering again in #getItems(), and offer an alternative through instanceof checks with #class and #constructor property. 2014-03-18 12:39:55 +01:00
Jürg Lehni
62f7b0d73e Simplify and merge Item#getItems() code with Project#getItems() 2014-03-18 11:47:50 +01:00
Jürg Lehni
833d71f7ea Remove Item#type and replace it with Item#className, the non-hyphenated version of #type. 2014-03-18 11:42:38 +01:00
Jürg Lehni
f115072e8c Rename HIERARCHY change-flag to more precise CHILDREN. 2014-03-17 18:59:10 +01:00
Jürg Lehni
0aa73d90c5 Change the way context dependent font sizes are handled by delegating handling to view.
Closes #425
2014-03-17 16:41:57 +01:00
Jürg Lehni
438de7013a Correctly handle groups as clipping masks.
Closes #370.
2014-03-17 14:51:47 +01:00
Jürg Lehni
0fe52a7d39 Implement an optimization in _changed() notifications where not all curves need to updated if only segments change that already have told their curves about the change. 2014-03-17 14:35:33 +01:00
Jürg Lehni
d594b4264d Define settings.applyMatrix and inherit at Item creation time. 2014-03-04 09:30:04 +01:00
Jürg Lehni
7dbf6ceaff Move Project#options to PaperScope#settings and define reasonable defaults. 2014-03-04 09:29:28 +01:00
Jürg Lehni
36e3cbddf2 Remove inheritance of Item#applyMatrix setting again.
Implementation cannot be solved well, since hierarchy is not known at creation time of item.
2014-03-02 21:00:08 +01:00
Jürg Lehni
80a725d08a Rename Item#transformContent to the more correct Item#applyMatrix 2014-03-02 16:04:17 +01:00
Jürg Lehni
fb1420eee0 Internalize Item#applyMatrix() code in #transform() and add short-cut method to it in Matrix#apply() 2014-03-02 15:50:45 +01:00
Jürg Lehni
6fdb9f60bd Merge branch 'refs/heads/master' into apply-matrix 2014-03-02 01:27:50 +01:00
Jürg Lehni
7bf9cc88e4 Merge pull request #387 from mgrabovsky/master
Fix typo in comment
2014-03-02 01:05:21 +01:00
Jürg Lehni
4ba17127aa Make sure that #transformContent can only be set to true on items that actually support it. 2014-03-01 23:24:33 +01:00
Jürg Lehni
1a836a168f Merge branch 'refs/heads/master' into apply-matrix
Conflicts:
	src/item/Item.js
2014-03-01 22:55:54 +01:00
Jürg Lehni
a8578326ea Inherit #transformContent setting from parent, if not explicitely defined. 2014-03-01 22:52:00 +01:00
Jürg Lehni
dad7821ee9 Include Item#transformContent in serialization and cloning. 2014-03-01 22:51:01 +01:00
Jürg Lehni
7cf4591a1e Define Item#style before calling #addChild() in #initialize(), to avoid issues with layers. 2014-03-01 22:49:46 +01:00
Jürg Lehni
a3114e5c28 Do not preserve matrix transformations in empty groups when applied to inexisting content. 2014-03-01 22:48:44 +01:00
Jürg Lehni
c1ccdf6cb7 Take into account the view's resolution in Item#rasterize() 2014-02-26 16:20:19 +01:00
Jürg Lehni
ec0877962b Expose the view's pixel-ratio and resolution through View#pixelRatio and View#resolution 2014-02-26 16:19:48 +01:00
Jürg Lehni
ccfd51a65a Improve performance of Path constructors and handling of { insert: false } Item creation. 2014-02-26 16:15:51 +01:00
Jürg Lehni
737466d15c Fix all faulty {@true} doc statements. 2014-02-26 15:39:00 +01:00
Jürg Lehni
bf50bd649a Fix issue in Item#rasterize() when resolution is not 72 DPI.
Closes #412.
2014-02-26 11:54:14 +01:00
Jürg Lehni
86e4d2a6b9 Implement Curve#remove() and Path#reduce().
Also have Item#reduce() recursively call #reduce() on reduced children.
2014-02-20 02:50:39 +01:00
Jürg Lehni
74a153dd88 Some code clean-up.
More to come.
2014-02-17 20:59:38 +01:00
Jürg Lehni
568bb06853 Add comments about missing #importSVG() documentation. 2014-02-12 09:39:34 +01:00
Matěj Grabovský
890eda9197 Fix typo in comment 2014-01-15 18:04:51 +01:00
Jürg Lehni
5a131930fb Add _dontNotify parameter to Matrix#reset() and use it in Item#applyMatrix() 2014-01-06 00:18:40 +01:00
Jürg Lehni
6ad2105110 Replace delete in favor of setting to undefined to prevent V8 deoptimization. 2014-01-05 19:16:48 +01:00
Jürg Lehni
706fe2c77d Rearrange Base.read argument sequence.
options are used more often than length.
2014-01-05 18:31:24 +01:00
Jürg Lehni
b66c41e1c9 Remove need for arguments[1] in Item#transform() 2014-01-05 18:05:47 +01:00
Jürg Lehni
8d08d3c014 Remove the need for arguments[0] in bounds getters. 2014-01-05 18:01:38 +01:00