Commit graph

5466 commits

Author SHA1 Message Date
Samuel Asensi
8bef865892 Fix children global matrices are not cleared (#1552)
Between a parent transformation and next view update, children global
matrix was invalid, leading to wrong global coordinates calculation.
Closes #1448
2018-10-13 16:28:20 +02:00
Samuel Asensi
60f9d868a6 Fix Path#arcTo() do not pass by through point (#1543)
Closes #1477
2018-10-13 15:33:21 +02:00
Samuel Asensi
5cd1ca13c5 Fix item global matrix error (#1562)
Bug happen when item is drawn after an empty symbol that should be drawn
in a separate canvas context (partial opacity or special blend mode).
As bounds are empty, symbol drawing process is interrupted but its
global matrix is not removed from the stack.
Closes #1561
2018-10-13 14:41:38 +02:00
Jürg Lehni
5245436e36 Do not polute global scope with paper object
Closes #1544
2018-10-10 23:10:51 +02:00
Jürg Lehni
4c035ada36 Minor fixes in comments and tests. 2018-10-10 23:03:57 +02:00
Samuel Asensi
76d07892d1 Add Item#locked to documentation (#1556)
Closes #1436
2018-10-09 22:05:22 +02:00
Samuel Asensi
bca5480640 Fix first mouse drag event is emitted twice (#1553)
Closes #1447
2018-10-09 22:04:18 +02:00
Samuel Asensi
dfe4397a96 Improve hit test point documentation (#1559)
Specifies that hit test point should be provided in global coordinates
system.
Closes #1430
2018-10-09 21:44:04 +02:00
Samuel Asensi
c0abbe1459 Fix raster shadow is not drawn (#1555)
Closes #1437
2018-10-09 11:38:52 +02:00
Jürg Lehni
fd1a517e84 Improve hex Color parser
Addresses changes in #1469
2018-10-06 21:57:30 +02:00
sasensi
f7ce43a9e9 Fix item selected position with matrix not applied
Make sure selected position is drawn in global coordinates system
whether item is in a group or not and whether matrix is applied or not.
Correct a bug introduced in 34679614c0.
2018-10-06 13:15:27 +02:00
PeterLazar
a8f78859cb Add hexadecimal with alpha color parsing
Closes #1468
2018-10-05 20:14:20 +02:00
Jürg Lehni
f5366fb3cb Some minor adjustments for #1530 2018-10-05 10:01:51 +02:00
Samuel Asensi
c235d6a917 Implement Curve#getTimesWithTangent()
and Path#getOffsetsWithTangent()
2018-10-05 09:44:42 +02:00
Jürg Lehni
47af603173 Support alpha channel in named CSS colors
Closes #1539
2018-10-04 17:26:48 +02:00
Jürg Lehni
28dec90a88 Wrap up Raster#smoothing feature 2018-10-03 19:01:02 +02:00
Jürg Lehni
144370169e
Merge pull request #1529 from sasensi/Fix_#1521_adding_raster.smoothing_property
Fix #1521 adding Raster.smoothing property
2018-10-03 18:38:01 +02:00
Jürg Lehni
6a278c040a Minor clean-ups for the past few PRs 2018-10-03 18:21:26 +02:00
Jürg Lehni
959ccc83c2
Merge pull request #1531 from sasensi/Fix_#1503_Item#position_caching_issue
Fix #1503 Item#position caching issue
2018-10-03 17:33:24 +02:00
Jürg Lehni
27b92a6007 Improve handling of push() with lots of items
Improves fix for #1493, should pass CI again
2018-10-03 16:45:38 +02:00
Jürg Lehni
da3a36230f Color: Improve CSS string parser and docs 2018-10-03 15:56:15 +02:00
Jürg Lehni
9201ea973e
Merge pull request #1533 from sasensi/Fix_#1501_errors_with_event_listeners_on_mobile
Fix #1501 errors with event listeners on mobile
2018-10-03 10:22:49 +02:00
Jürg Lehni
a148e61129
Merge pull request #1534 from sasensi/Fix_#1493_Path#add_crashes_whith_1000000_segments
Fix #1493 Path#add crashes whith 1000000 segments
2018-10-03 10:18:15 +02:00
Jürg Lehni
f032dcbf06
Merge pull request #1535 from sasensi/Fix_selected_position_is_wrongly_placed_when_item_is_in_a_group_with_matrix_not_applied
Fix: selected position is wrongly placed when item is in a group with matrix not applied
2018-10-03 10:16:59 +02:00
sasensi
34679614c0 Fix: selected position is wrongly placed when item is in a group with matrix not applied 2018-10-03 09:43:40 +02:00
sasensi
d12b99e252 Improve Path#add performance with big arrays 2018-10-03 08:59:36 +02:00
sasensi
f673542640 Refactor code to fit style rules 2018-10-02 19:28:35 +02:00
sasensi
c034ebf554 Refactor code to fit style rules 2018-10-02 19:20:12 +02:00
sasensi
fc5bb4b10e Fix #1493 Path#add crashes whith 1000000 segments 2018-10-02 14:09:34 +02:00
sasensi
54e1a0c1ef Fix: calling event.preventDefault() on not cancelable events produces errors 2018-10-02 10:31:49 +02:00
sasensi
cb9fbd7789 Fix #1501 document touchstart/touchmove events are passive by default in chrome and event.preventDefault() calls are ignored 2018-10-02 10:29:39 +02:00
sapics
cce5b24e9a Fix:SvgImport apply attributes to item #1416 2018-10-02 16:35:32 +09:00
sasensi
704d37be2f Fix #1503 Item#position caching issue 2018-10-01 19:25:04 +02:00
sasensi
07ae09a76a Fix #1521 adding raster.smoothing property 2018-09-30 18:46:02 +02:00
Jürg Lehni
53897d7498 Simplify code from #1528 2018-09-29 16:26:47 +02:00
DD
bf63bf223c Add rotate case as well 2018-09-29 16:19:32 +02:00
DD
8d0fecbb1b For SVG import, If second argument is missing in translate, assume that it's zero. Currently it assumes that y matches x if y is missing. 2018-09-29 16:19:09 +02:00
Jürg Lehni
8792d142b3 Some code cleanup for #1515 2018-09-29 15:09:02 +02:00
Jürg Lehni
ef2c56b164
Merge pull request #1515 from sasensi/Fix_#1506_#1513_by_checking_winding_quality_in_boolean_subtraction
Fix #1506 #1513 by checking winding quality in boolean subtraction
2018-09-29 14:51:18 +02:00
sapics
e057f20f37
Merge pull request #1511 from sapics/free-memory2
Release memory on Color
2018-09-29 13:31:38 +09:00
sapics
eb740c2452 Minor fix 2018-09-29 12:29:12 +09:00
Bojan Hribernik
6925888024 Fix Cannot read property 'parent' of undefined in node
This happens in webpack bundle in node server rendering react application:
```js
TypeError: Cannot read property 'parent' of undefined
    at Object.eval (webpack:///./node_modules/paper/dist/node/self.js?:20:28)
    at eval (webpack:///./node_modules/paper/dist/node/self.js?:62:30)
    at Object../node_modules/paper/dist/node/self.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:34531:1)
    at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
    at Object.eval (webpack:///./node_modules/paper/dist/paper-core.js?:35:16)
    at eval (webpack:///./node_modules/paper/dist/paper-core.js?:14798:3)
    at Object../node_modules/paper/dist/paper-core.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:34553:1)
    at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
    at eval (webpack:///./node_modules/react-paper-bindings/lib/View.js?:15:18)
    at Object../node_modules/react-paper-bindings/lib/View.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:37188:1)
```
2018-09-29 12:14:32 +09:00
sapics
e9c4e8cf3b Release memory on Color 2018-09-27 18:39:39 +09:00
sapics
f8d8b5cc03
Code style fix: replace tabs to spaces 2018-09-27 16:47:17 +09:00
sasensi
9a8aae00bd Fix #1506 #1513 by checking winding quality in boolean subtraction 2018-09-26 14:05:29 +02:00
sasensi
6ca654d6d3 fix Path.splitAt() documentation example 2018-09-20 12:24:35 +02:00
Jürg Lehni
a61e83edf2 Simplify fix for #1452 2018-03-06 12:57:05 +01:00
Jonathan Park
74bb49d8c0 fix issue with svg import of raster images
When importing rasters after load if the image has a matrix with any translation/skew value
the image will calculate the wrong matrix after loading.

In order to correct this we append the translation rather than prepend so
that it happens in the correct order relative to the transformation.
2018-03-02 00:19:43 +00:00
Jürg Lehni
5f6c70d316 Use proper new statement in deserialization 2018-02-03 22:39:57 +01:00
Jürg Lehni
ec1e3262b6
Merge pull request #1374 from alexjlockwood/patch-2
Fix documentation for Shape#toPath()
2018-01-16 11:03:55 +01:00
Jürg Lehni
193592b88b Release version 0.11.5 2017-10-08 17:48:07 +02:00
Jürg Lehni
0deddebb2c Merge pull request #1382 from sapics/patch-1
Fix path.isSelected
2017-10-05 16:16:29 +02:00
Jürg Lehni
702ab748a2 JSHint: Fix error 2017-10-05 12:09:07 +02:00
Jürg Lehni
6c5f1dc671 Node.js: Clean up image stream handling 2017-10-04 22:39:19 +02:00
therewasaguy
6939c1674b Node.js: Add JPEG support to exportFrames()
Closes #1166
2017-10-04 22:25:30 +02:00
Jürg Lehni
7412939096 Boolean: Add better filtering for invalid segments
Fixes #1385
2017-10-04 21:43:56 +02:00
Jürg Lehni
10f464edfc Boolean: Check that overlaps are on the right path
Closes #1321
2017-10-04 17:52:09 +02:00
Carl Saldanha
6a96a11549 Events: Fix auto-filling issue on Chrome
Closes #1358, closes #1365
2017-10-04 17:08:10 +02:00
sapics
1c5887433b Fix path.isSelected
This fixes #1378
2017-09-21 13:42:55 +09:00
Alex Lockwood
d51bb3fa31 Fix documentation for Shape#toPath() 2017-09-04 11:13:15 -04:00
Jürg Lehni
c403c86a23 Release version 0.11.4 2017-06-10 14:32:21 +02:00
Jürg Lehni
5d00c30ece Some internal refactoring. 2017-06-07 16:56:44 +02:00
Jürg Lehni
a6174d45a0 Fix documentation error.
Closes #1332
2017-05-28 11:04:11 +02:00
Jürg Lehni
bbb7bfeba7 Release version 0.11.3 2017-04-23 17:15:03 +02:00
Jürg Lehni
fbd5eeb7ef Mouse Events: Fix item-based doubleclick events.
Closes #1316
2017-04-22 20:01:08 +02:00
Jürg Lehni
188c006197 Update to straps.js v3.0.1 and make all functions and accessors enumerable. 2017-04-22 18:50:53 +02:00
Jürg Lehni
b26b056522 Prevent consumed properties in object literal constructors from being set on the instance.
We need to make sure arguments.__filtered survives constructor calls.
2017-04-22 13:52:03 +02:00
Jürg Lehni
e46c8ec340 Overhaul the caching of bounds and matrix decomposition.
Improves reliability of Item#rotation and #scaling and fixes situations caused by wrongly cached #position and #bounds values.
2017-04-22 12:55:42 +02:00
Jürg Lehni
90f816f959 Release version 0.11.2 2017-04-20 19:34:40 +02:00
Jürg Lehni
9320a720c2 PaperScript: Fix parsing error in math operations without white-space.
Closes #1314
2017-04-20 19:14:30 +02:00
Jürg Lehni
5046d6968b Release version 0.11.1 2017-04-20 18:43:16 +02:00
Jürg Lehni
d0a4532d94 Release version 0.11.0 2017-04-19 22:07:46 +02:00
Jürg Lehni
6ff6e1a05d Improve documentation about new NPM modules.
Relates to #1252
2017-04-19 20:27:14 +02:00
Jürg Lehni
a7d259bfc0 Release version 0.10.4 2017-04-19 19:55:21 +02:00
Jürg Lehni
7dea96c6f2 Docs: Fix wrong @link references to bean properties. 2017-04-13 12:24:56 +02:00
Jürg Lehni
2290ec0ff6 Improve unit test for new Path.Constructor({ insert: false }) 2017-04-10 09:30:52 +02:00
sapics
08b9dcecb8 Fix Path.Constructors.js initialization 2017-04-10 12:17:56 +09:00
Jürg Lehni
d436d07fee Intersections: Correctly handle item#applyMatrix = false
Closes #1289
2017-03-23 13:13:32 +01:00
Jürg Lehni
261fc02c1d SVG Import: Improve handling of sizes in percent.
Closes #1242
2017-03-23 00:14:03 +01:00
Jürg Lehni
a43db8427a Boolean: update documentation and optimize #divide()
#divide() with options.trace = false can call splitBoolean() just once without removing any split sub-paths.

Relates to #1221
2017-03-22 23:45:11 +01:00
Jürg Lehni
15471c76ab Boolean: Always return CompoundPath items.
Relates to #1221
2017-03-22 23:26:26 +01:00
Jürg Lehni
3c9d2eea1d Boolean: Implement options.trace, and add unit tests for options.trace = false
Relates to #1221
2017-03-22 15:03:11 +01:00
Jürg Lehni
ffa7e16f48 Use == false instead of === false for all options that default to true.
These expression are true:
- false == false
- false == 0
While these are false:
- false == null
- false == undefined
2017-03-22 14:42:11 +01:00
Jürg Lehni
dd56f86679 Boolean: Pass on options in PathItem#subtract(path, options)
Relates to #1221
2017-03-22 14:24:40 +01:00
Jürg Lehni
7e8e04351f Boolean: small optimization in computeStrokeBoolean() 2017-03-22 14:24:11 +01:00
Jürg Lehni
89d0536783 Scene Graphs: Do not allow inserting same item as child multiple times. 2017-03-21 11:55:42 +01:00
Jürg Lehni
29de03dc30 Node.js: Add code to handle separate shim modules.
Planend are the modules paper-jsdom and paper-jsdom-canvas, as shim modules that require and handle the dependencies as peer dependencies.

Relates to #1252
2017-03-20 12:38:52 +01:00
Jürg Lehni
48e9ef62a6 Boolean: Bring back on-path winding handling.
Relates to #1281
2017-03-20 01:02:12 +01:00
Jürg Lehni
49fca5510e Improve handling of Rectangle dimension properties.
Better deal with left / top / right / bottom / center values, and implement more unit tests for their behavior.

Closes #1147
2017-03-19 22:51:34 +01:00
Jürg Lehni
5c3e3ec34c Mouse Events: Improve mousedrag handling.
Relates to #1247, closes #1286
2017-03-19 16:15:34 +01:00
Jürg Lehni
7a2ccc6d44 More work on supporting hybrid contexts.
Relates to #1252
2017-03-19 16:03:29 +01:00
Jürg Lehni
89a953dde0 Docs: Add documentation for options.bound and options.matrix in #exportSVG()
Closes #1254
2017-03-19 14:50:59 +01:00
Jürg Lehni
e354bccf69 Include note about compiling for Electron.
And some smaller forgotten changes.

Closes #1276
2017-03-19 14:38:24 +01:00
Jürg Lehni
26993b2c36 Various minor improvements to getWinding() 2017-03-19 14:18:55 +01:00
Jürg Lehni
374107c439 Minor cleanup for previous commit. 2017-03-18 16:46:55 +01:00
Jürg Lehni
fdd42076f9 Intersections: Bring back special handling of curve end-points.
Revert commit 89e31dd393, and add further improvements:

- Implement unit tests for #1284
- Remove Rectangle#touches(rect) in favor of #intersects(rect, epsilon)

Closes #1284
2017-03-18 16:42:55 +01:00
Jürg Lehni
0ec06e7353 PaperScript: Give global.acorn the preference over the bundled one.
So people can load their own preferred version in sketch.paperjs.org

Relates to #1183
2017-03-11 20:53:35 +01:00
Jürg Lehni
29e7aba587 Prevent cleaning pre-existing styles when setting item.style to an object.
Until v0.10.2, doing so would merge in the new styles. We should keep this behavior for reasons of compatibility.

Closes #1277
2017-03-11 16:26:18 +01:00
Jürg Lehni
9a2f138f1d PaperScript: Fix positive unary operator. 2017-03-11 00:27:03 +01:00
Jürg Lehni
6ee59cd46e Prevent leakage of bundled Acorn into window.acorn
And fix Acorn loading under load.js
2017-03-10 23:56:06 +01:00