Commit graph

4910 commits

Author SHA1 Message Date
Jürg Lehni
d68239a541 SVG: Introduce SVGNode object to handle SVG Elements. 2016-02-01 12:31:18 +01:00
Jürg Lehni
3d346d8045 Core: Do not serialize deprecated Style#font property.
Relates to #934
2016-02-01 12:19:12 +01:00
Jürg Lehni
50843d8f87 Node: Switch to jsdom v8.0.1 with patched-in image support.
And fix XMLSerializer#serializeToString() to work with it.
2016-01-31 22:47:57 +01:00
Jürg Lehni
bc2729683c Core: Renamed Symbol and PlacedSymbol classes and properties.
- Symbol -> SymbolDefinition
- PlacedSymbol -> SymbolItem
- Symbol#definition -> SymbolDefinition#item
- PlacedSymbol#symbol -> SymbolItem#definition
- Deprecate Project#symbols

Closes #770
2016-01-31 16:52:51 +01:00
Jürg Lehni
1a3a4be0b6 Gulp: Implement publish task. 2016-01-31 14:30:14 +01:00
Jürg Lehni
90e1cf8f5e Canvas: Throw an error if a canvas cannot provide a 2D context. 2016-01-31 12:43:38 +01:00
Jürg Lehni
e02e9f4643 Node: Improve DOMParser#parseFromString() polyfill for Node.js
And no need to move imported SVG nodes into document, since we don't have styling in Node.js
2016-01-31 12:43:38 +01:00
Jürg Lehni
4c84c3dad5 Tests: Start getting QUnit tests to work on Node.js
Work in progress…
2016-01-31 12:43:20 +01:00
Jürg Lehni
0c1b4376d3 Core: Fix issue with RegExp detection if object is from another context. 2016-01-31 12:43:03 +01:00
Jürg Lehni
fadef949ff Node: Fix display of percentage in Node.js frames export. 2016-01-31 12:42:53 +01:00
Jürg Lehni
0455d39e33 Automatically determine correct padding for numbers in View#exportFrames() 2016-01-27 13:38:04 +01:00
Jürg Lehni
85d60e199e Get View#exportFrames() to work again on Node.js 2016-01-27 13:27:11 +01:00
Jürg Lehni
e7c4e3c990 Implement View#autoUpdate to control automatic updates.
Closes #921
2016-01-27 13:10:04 +01:00
Jürg Lehni
b56d18d6a4 Override DomEvent.requestAnimationFrame() in Node.js to avoid setInterval() timers 2016-01-27 13:02:50 +01:00
Jürg Lehni
414742459d Make sure PDF support actually works. 2016-01-27 12:51:26 +01:00
Jürg Lehni
1e649362bd Fix issue in View#exportImage() 2016-01-27 12:51:02 +01:00
Jürg Lehni
b40ff49523 Add explanation about View#_itemEvents.native. 2016-01-27 12:17:38 +01:00
Jürg Lehni
5fa0810ca3 Streamline View#_countItemEvent() code a bit. 2016-01-27 12:15:00 +01:00
Jürg Lehni
0cfa83fc32 Make item-level mousedrag events work again. 2016-01-27 12:11:59 +01:00
Jürg Lehni
d22104985d Fix spelling mistake. 2016-01-27 11:51:54 +01:00
Jürg Lehni
810428569a Some jshint related fixes. 2016-01-27 11:45:20 +01:00
Jürg Lehni
d92628a432 Make click and doubleclick events work on View. 2016-01-27 11:38:45 +01:00
Jürg Lehni
3276616f53 Introduce Item._itemHandlers to remove code redundancy. 2016-01-27 11:38:14 +01:00
Jürg Lehni
ed8a904b74 Some Curve._evaluateMethods related cleanup. 2016-01-27 11:37:12 +01:00
Jürg Lehni
849688833e Implement key events on View.
Closes #896
2016-01-27 11:36:39 +01:00
Jürg Lehni
0b991cefdd Only mark an image as loaded if it actually has src set and is complete. 2016-01-27 10:45:39 +01:00
Jürg Lehni
8391543115 Further improve Raster documentation. 2016-01-27 10:39:03 +01:00
Jürg Lehni
9cf912090c Implement Raster#_setImage() that doesn't trigger events.
For internal use / updates.
2016-01-27 10:33:01 +01:00
Jürg Lehni
26a64415a5 Document Raster#onLoad() and #onError() 2016-01-27 10:32:28 +01:00
Jürg Lehni
c5632d8a6a Improve documentation for event handlers on View and Item. 2016-01-27 10:27:14 +01:00
Jürg Lehni
52017340d2 Do not fire two subsequent mousedown events.
This should fix #922, but needs testing.
2016-01-27 09:53:09 +01:00
Jürg Lehni
caa93a51ca Improve handling of removeOn*() and filter out duplicate move events.
Closes #913
2016-01-27 09:48:20 +01:00
Jürg Lehni
ee4760afc4 Fix issue with zoomed retina canvases when repeatetly initializing same view canvas. 2016-01-27 09:38:57 +01:00
Jürg Lehni
e722be5b62 Add support for PDF canvas on Node.js again. 2016-01-27 09:34:37 +01:00
Jürg Lehni
86f6d8eccd Fix crash in unit tests. 2016-01-26 23:27:38 +01:00
Jürg Lehni
4af8999135 Clean up View#_handleFrame() 2016-01-26 22:35:46 +01:00
Jürg Lehni
b71ffdbe71 Remove all direct calls to view.update() and favor of the new view.requestUpdate()
Pure window.requestAnimationFrame() smoothness, automatic updates even when working directly from JavaScript, and no more slow-downs from onLoad events!

Closes #830, #925
2016-01-26 21:37:27 +01:00
Jürg Lehni
9ad63a7231 Merge branch 'unified-version' into develop 2016-01-26 21:06:54 +01:00
Jürg Lehni
5e69de3bd1 Restructure event handling on Raster item.
- Trigger #onLoad() events from Raster#setImage() also
- Add support for Raster#onError() handler
Closes #849 and #924
2016-01-26 21:06:36 +01:00
Jürg Lehni
d33fff31b8 Always access "global" constructors on window object now. 2016-01-26 20:33:19 +01:00
Jürg Lehni
77be5616b6 Include paper-core.js in load.js mechanism, and improve root folder guessing again. 2016-01-26 20:26:32 +01:00
Jürg Lehni
6a099003b2 Improve some comments about new file structure. 2016-01-26 20:14:49 +01:00
Jürg Lehni
e1a51f858a More work on unified version for browsers and node.
Relates to #739
2016-01-26 20:02:23 +01:00
Jürg Lehni
8b994ab640 Use paper.js indentation standard. 2016-01-26 17:02:08 +01:00
Jürg Lehni
87e6c0f2c3 Merge pull request #927 from sapics/minor-minifier
Simplify calculation in PathFitter
2016-01-26 17:00:02 +01:00
Jürg Lehni
a38834b81d Further refined code from 095cd47c1c 2016-01-26 16:59:27 +01:00
Jürg Lehni
15797903cf Update to jsdom v7.2.2 with https://github.com/tmpvar/jsdom/pull/1366 back-portedd. 2016-01-26 16:51:40 +01:00
Jürg Lehni
7781ecb76a Some minor cleanups. 2016-01-26 16:29:13 +01:00
Jürg Lehni
46f415ca81 More work on source-map support for node.js
Relates to #656
2016-01-26 12:38:58 +01:00
Jürg Lehni
c479ec9272 Start with transition to unified version.
Relates to #739
2016-01-26 11:41:49 +01:00
sapics
e8137ccedb Simplify calculation in PathFitter 2016-01-26 19:34:27 +09:00
sapics
095cd47c1c Minifier matrix._transformCoordinates function 2016-01-26 12:07:34 +09:00
Jürg Lehni
1ae95999d5 Fix CompoundPath#insertChildren() when passing children lists from otheer items. 2016-01-24 17:59:39 +01:00
Jürg Lehni
fb9bdb4b39 Fetch all dev-dependencies NPM instead of Bower. 2016-01-23 19:01:38 +01:00
Jürg Lehni
145135b4f5 Give tracePaths() the capability to deal with open paths.
Relates to #912
2016-01-23 11:40:22 +01:00
Jürg Lehni
36e31eb250 Implement better handling of Raster#source and Raster#toDataURL() on Node.js
Closes #914
2016-01-22 17:05:50 +01:00
sapics
ecc36ec3cc Remove unused variable in group._draw 2016-01-20 14:35:28 +09:00
Jürg Lehni
e4b03a7915 More code cleanup and simplifications in Matrix.
Relates to #915
2016-01-19 10:14:20 +01:00
sapics
627a63cc5b Fix matrix invert calculation 2016-01-19 16:08:39 +09:00
Jürg Lehni
6a0222ff21 Minor cleanup. 2016-01-18 11:03:30 +01:00
Jürg Lehni
8f0a2f37a0 Merge pull request #911 from sapics/hit-stroke
Add stroke hit-test option for shape items
2016-01-18 10:57:42 +01:00
Jürg Lehni
5cb4ab732b Improve code explanation in load.js 2016-01-18 10:21:28 +01:00
Jürg Lehni
503fe11e41 Fix build issues on Travis and improve version handling in Gulp.js and Prepro.js
This reverts commit eaceb1bfc3.
2016-01-18 09:56:02 +01:00
sapics
9c4296eda0 Add stroke hit-test option for shape items 2016-01-18 10:04:53 +09:00
Jürg Lehni
eaceb1bfc3 Some more work on gulp
Change the way versions are handled, and append the branch name if we're not publishing from master.
2016-01-18 01:18:57 +01:00
Jürg Lehni
4351ca310f Fix hit-testing on Shape items and #strokeScaling.
Closes #697.
2016-01-18 00:41:48 +01:00
Jürg Lehni
1ac8e46d55 Various fixes on handling of #strokeScaling and #strokeBounds calculations. 2016-01-17 23:57:56 +01:00
Jürg Lehni
ea7216d9fb Improve _getStrokeMatrix() fix to correctly handle nested matrices. 2016-01-17 23:39:28 +01:00
Jürg Lehni
fd72ad0937 Correctly handle #strokeScaling in Path item hit-tests.
Hit-testing of Shape items with #strokeScaling still needs fixing too.
Relates to #697.
2016-01-17 21:46:35 +01:00
Jürg Lehni
43a6c57cd6 Correctly handle #strokeScaling when calculating Path and Shape bounds.
Relates to #697
2016-01-17 20:27:25 +01:00
Jürg Lehni
40551fcacf Make Matrix#orNullIfIdentity() private too, and fix error introduced by previous commit. 2016-01-17 19:34:54 +01:00
Jürg Lehni
d292e08ed2 Various renaming and introduction of additional methods in Matrix
- Rename Matrix#concatenate() to #append() and #preConcatenate() to #prepend().
- Over #invert() as alternative to #inverted(), directly modifying the matrix.
- Make Matrix#_shiftless() and internal function.
- Introduce versions that return copies instead, named #appended(). (previously #chain()) and #prepended().
- Rename internal Path#_getPenPadding() to #_getStrokePadding().
2016-01-17 19:30:47 +01:00
Jürg Lehni
2ed9fae105 Fix issue with PaperScript compilation if no url is specified.
Also change a few related things:
- Move url in PaperScript#execute() into options object
- Document PaperScope#execute()

Closes #902
2016-01-17 17:32:23 +01:00
Jürg Lehni
c8bc179928 Big refactoring of the build process, now entierly Gulp based. 2016-01-17 04:32:28 +01:00
Jürg Lehni
36cb88de4d Write documentation for Project#addLayer() and #insertLayer()
Closes #903
2016-01-16 16:51:47 +01:00
Jürg Lehni
7783ebeed1 Explain reasons for /* jshint */ statements.
And consistently name Prepro.js
2016-01-16 15:37:02 +01:00
Jürg Lehni
00d2002b6f Follow convention for multi-line if-statements.
Relates to #907
2016-01-16 15:13:45 +01:00
Jürg Lehni
3a3d46692b Give view proper Matrix transformation functions, just like on Item.
Relates to #832
2016-01-16 15:10:28 +01:00
Jürg Lehni
b3e81af9b6 Merge pull request #907 from iconexperience/getMonoCurves-performance-improvement
Improve performance of _getMonoCurves() by filtering more curves
2016-01-16 15:09:16 +01:00
iconexperience
5de9558533 Add performance improvement of _getMonoCurves() by filtering curves that have end points and control points sorted in y direction. 2016-01-16 15:05:49 +01:00
Jürg Lehni
7fa013092e Define View#matrix, giving access to more fine-grained control over the view transformation.
Relates to #832
2016-01-16 14:25:11 +01:00
Jürg Lehni
2669d06642 Merge Item#_remove() and Layer#_remove().
And add Project#_changed(), so it can be called through #_getOwner().
2016-01-16 14:21:05 +01:00
Jürg Lehni
1e7faaa95f Replace Project#addChild(), #insertChild() with #addLayer() and #insertLayer()
Also replace #_addToProject() with new #_insertItem() helper, and streamline all #_insertSibling() related methods.

Relates to #903
2016-01-16 13:56:01 +01:00
Jürg Lehni
f60c984746 Update JSDoc. 2016-01-16 00:14:41 +01:00
Jürg Lehni
7f51ceaa34 Throw exception if segments or curves of wrong paths are passed to smooth() 2016-01-16 00:07:29 +01:00
Jürg Lehni
1bc2d2fffe Fix bug with mouse events in scripts without tools. 2016-01-15 23:45:58 +01:00
Jürg Lehni
884a0c54ad Update JSDoc, and some minor documentation changes. 2016-01-15 23:42:20 +01:00
Jürg Lehni
16e42c68fd Various minor documentation fixes (mainly capitalization). 2016-01-15 23:22:08 +01:00
Jürg Lehni
1e97b405ba Finish documenting #smooth(). 2016-01-15 20:14:56 +01:00
Jürg Lehni
80320431fe Fix smoothing of ranges with negative indices. 2016-01-15 18:20:52 +01:00
Jürg Lehni
56e0048186 Add documentation for PathItem#smooth() and Segment#smooth()
Closes #338
2016-01-15 18:14:22 +01:00
Jürg Lehni
96c50abce2 Prevent exception when selecting not inserted segments. 2016-01-15 17:32:01 +01:00
Jürg Lehni
31297c359a Update JSDoc.
Now with proper Markdown support!
2016-01-15 17:21:49 +01:00
Jürg Lehni
6262863d9f Use correct segment index boundaries in Path#smooth(). 2016-01-15 16:35:48 +01:00
Jürg Lehni
34dc0e1589 Fix geometric and catmull-rom smooth on closed paths. 2016-01-15 12:10:43 +01:00
Jürg Lehni
aba6f03230 Further simplify continuous smooth code, and add support for original method, now called asymmetric.
For backward compatibility, we default to asymmetric for now, but will switch to continuous when hitting v1.0.0.

Relates to #338
2016-01-15 11:24:47 +01:00
Jürg Lehni
5440f96a77 Shorten new continuous smooth code. 2016-01-15 10:37:04 +01:00
Jürg Lehni
978aaf9f3b Introduce Item flag to selectively activate on stroke-scaling on classes that support it.
Closes #721
2016-01-15 09:56:10 +01:00
Jürg Lehni
1563f69ce9 Layers should not be turning up in hit-tests.
Closes #608
2016-01-14 19:33:48 +01:00
Jürg Lehni
cd366982d6 Some minor improvements in handling of selectedItems. 2016-01-14 19:19:39 +01:00