From e354bccf6973dc0f71fdf621762f31828d97718c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 19 Mar 2017 14:38:24 +0100 Subject: [PATCH] Include note about compiling for Electron. And some smaller forgotten changes. Closes #1276 --- CHANGELOG.md | 2 ++ README.md | 13 ++++++++++++- src/item/SymbolItem.js | 2 +- test/tests/Path_Boolean.js | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 677c5175..eb763fd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,8 @@ - Hit Tests: Fix stroke hit-testing for rounded shape items (#1207). - Fix matrix cloning for groups with `#applyMatrix = false` ( #1225). - Correctly handle offset in `Curve#divideAt(offset)` (#1230). +- Fix issue with `Curve#isStraight()` where handles were checked incorrectly + for collinearity (#1269). - Fix `Line#getSide()` imprecisions when points are on the line. - Docs: Fix documentation of `Project#hitTestAll()` (#536). - Docs: Improve description of `option.class` value in `Project#hitTest()` diff --git a/README.md b/README.md index 5b8d1be9..112ecd56 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ And from there onwards, you should be able to use Bower like this: bower search paperjs -### Installing Paper.js for Node.js through NPM +### Installing Paper.js for Node.js NPM is used to install Paper.js for use in Node.js. But before installing, you need the Cairo Graphics library installed, see: . @@ -125,6 +125,17 @@ You should now be able to install the Paper.js module from NPM: npm install paper +### Installing Paper.js for Electron + +[Node-Canvas](https://github.com/Automattic/node-canvas) is a native dependency. +In order to build it for use in Electron, which is likely to use a different +version of V8 than the Node binary installed in your system, you need to +manually specify the location of Electron’s headers. Follow these steps to do +so: + +[Electron — Using Native Node +Modules](https://electron.atom.io/docs/tutorial/using-native-node-modules/) + ## Development The main Paper.js source tree is hosted on diff --git a/src/item/SymbolItem.js b/src/item/SymbolItem.js index 2e992d74..aad3506c 100644 --- a/src/item/SymbolItem.js +++ b/src/item/SymbolItem.js @@ -118,7 +118,7 @@ var SymbolItem = Item.extend(/** @lends SymbolItem# */{ return item._getCachedBounds(item._matrix.prepended(matrix), options); }, - _hitTestSelf: function(point, options, viewMatrix, strokeMatrix) { + _hitTestSelf: function(point, options, viewMatrix) { var res = this._definition._item._hitTest(point, options, viewMatrix); // TODO: When the symbol's definition is a path, should hitResult // contain information like HitResult#curve? diff --git a/test/tests/Path_Boolean.js b/test/tests/Path_Boolean.js index fc6a4c08..632129f5 100644 --- a/test/tests/Path_Boolean.js +++ b/test/tests/Path_Boolean.js @@ -864,7 +864,7 @@ test('#1123', function() { 'M100,200v-100h100v100zM180,180v-60h-60v60z'); }); -test('#1239', function() { +test('#1239 / #1073', function() { var p1 = new Path([[890.91, 7.52, 0, 0, 85.40999999999997, 94.02], [1024, 351.78, 0, -127.03999999999996, 0, 127.14999999999998], [890.69, 696.28, 85.54999999999995, -94.03999999999996, 0, 0], [843.44, 653.28, 0, 0, 75.20000000000005, -82.66999999999996], [960, 351.78, 0, 111.75, 0, -111.63], [843.65, 50.51999999999998, 75.07000000000005, 82.63999999999999, 0, 0], true]); var p2 = new Path([[960, 352, -0.05999999999994543, 111.67999999999995, 0, 0], [1024, 352, 0, 0, -0.05999999999994543, 127.07], [890.69, 696.28, 85.5, -93.98000000000002, 0, 0], [843.44, 653.28, 0, 0, 75.14999999999998, -82.61000000000001], true]); project.activeLayer.scale(0.25);