Commit graph

807 commits

Author SHA1 Message Date
Jürg Lehni
ef8ba35911 Implement unit tests for 3ff5560c0c
Closes #1419, closes #1263
2019-06-22 18:21:47 +02:00
Jürg Lehni
f66c73e534 Fix regression in curve-intersections code
Closes #1638
2019-06-22 15:27:25 +02:00
Samuel Asensi
4172eafba0 Add/unit test for color change propagation (#1675)
Relates to #1672
2019-06-22 15:17:35 +02:00
Jürg Lehni
b5c753f23d Improve test for #1651
Move to the right place and simplify to only test against a non-invertible matrix.
2019-06-19 22:05:26 +02:00
Dan Stucky
32aff8e895 Handle non-invertible matrices in Item#contains() (#1651) 2019-06-19 21:59:41 +02:00
Samuel Asensi
c04746aa00 Fix SVG export with Symbol (#1670)
Closes #1668
2019-06-18 06:15:20 +02:00
sasensi
3177c7ac46 Fix Path#arcTo() when from/to points are equal
Closes #1613
2019-06-10 00:01:46 +02:00
Jürg Lehni
4ba406bfe3 Streamline code for #1427 2019-06-09 23:35:33 +02:00
sasensi
e3c298d3f4 Fix ignoring of clip item matrix in group internal bounds
Closes #1427
2019-06-09 23:28:30 +02:00
Jürg Lehni
4aa1bebf26 Improve handling of increment/decrement operators
Closes #1450
2019-06-09 19:29:07 +02:00
sasensi
80131f0398 Fix PaperScript#compile() with prefix operators
Closes #1611
2019-06-09 19:23:53 +02:00
Jürg Lehni
aca3059814 Move color owner handling directly to Color class
There was already Color#_owner, now there is Color#_setter too
2019-06-09 18:01:42 +02:00
sasensi
06e0c43325 Fix change propagation with colors on groups
Closes #1152
2019-06-09 17:54:18 +02:00
sasensi
25f2a0e779 Fix drawing with compound-paths as clip-items
Closes #1361
2019-06-09 16:37:38 +02:00
sasensi
0eae0b6e4d Prevent Item#importJSON() from overriding Item#insert()
Closes #1392
2019-06-09 16:28:20 +02:00
sasensi
eeb26436b0 Fix bounds error with nested empty items
Closes #1467
2019-06-09 16:10:54 +02:00
Jürg Lehni
c5b304bb78 Exclude gradients-2 test again on phantomjs
Reverting 5cb93ec46e 🤦‍♂️
The isNode() shenanigans was masking this issue
2019-06-09 14:57:02 +02:00
sasensi
5a3cf624aa Fix importSVG() linear gradient x2 default values 2019-06-09 14:42:52 +02:00
Jürg Lehni
1e2bbbdef2 Fix handling of native classes in tests again
Reverting breaking change in 10bdafa826
2019-06-09 14:34:32 +02:00
Jürg Lehni
5cb93ec46e Enable gradients-2 test in test:phantom
It doesn't seem to struggle with it anymore….
2019-06-09 14:06:35 +02:00
sasensi
4f282cec4b Fix SVG imported gradients default values
Add default values based on SVG specification document.
Closes #1632
2019-06-09 14:01:34 +02:00
Jürg Lehni
7e850d0e55 Fix resemble.js warnings during tests 2019-06-09 13:55:41 +02:00
Jürg Lehni
10bdafa826 Simplify preserving of native classes in tests 2019-06-09 13:42:20 +02:00
sapics
c30767ed2e Fix SvgExport when item.matrix is not invertible 2019-06-07 22:44:44 +02:00
Samuel Asensi
de824e1846 Fix exported SVG missing viewBox attribute (#1576)
SVG viewBox attribute was not added when bounds rectangle point was 0,0.
2019-06-07 22:30:01 +02:00
sasensi
314390d789 Improve new Raster(size[, position]) constructor
Closes #1621
2019-06-07 22:25:44 +02:00
Samuel Asensi
598d9a3356 Add SVG switch support (#1597)
SVG <switch> is simply parsed as a group because conditional attributes
cannot be evaluated in paper.js context.
Relates to #1389
2019-06-07 15:06:46 +02:00
Jürg Lehni
da137fa8e4 Use comparePixels() instead of compareCanvas() 2019-06-05 18:16:56 +02:00
Jürg Lehni
2cb55a839d Update dependencies 2019-06-05 18:13:22 +02:00
Jürg Lehni
88c4275fa3 Keep code on 80 chars per line 2019-06-05 17:36:56 +02:00
Jürg Lehni
022a4c9c81 Fix temporary test name 2019-06-05 17:35:42 +02:00
sapics
be4199b6eb Update copyright year to 2019 2018-12-27 16:13:01 +09:00
sapics
5904a288e7 Fix css color parse 2018-12-14 11:44:24 +01:00
sapics
cfc5a912da Replace url to avoid redirection
Replace http://jonathanpuckey.com to https://puckey.studio
2018-11-14 11:24:32 +01:00
Samuel Asensi
2968faad51 Fix empty image drawing (#1605)
Empty raster (for example coming from path with empty bound
rasterization, ...) drawing threw error.
This change prevent raster drawing in that case.
Closes #1320
2018-11-14 11:21:40 +01:00
sasensi
655a4dabd0 Add tolerance parameter to test method compareCanvas() 2018-11-06 12:07:01 +01:00
sasensi
337538b21a Remove reference to CanvasProvider in test methods 2018-11-06 11:26:12 +01:00
sasensi
2e75467fb4 Fix group selected bounds and position color
Group selected color was applied differently to its bounds and position
depending on whether it had children or not when selected color was set.
This resulted in an unpredictable behaviour from a user point of view.
To change that:
- When `item.setSelectedColor()` is called, value is now always stored
in `item._style._values`, independently from the fact that item has
children or not.
- An helper method `compareCanvas()` is added to the test suite to allow
comparing selection rendering of a known working case to a failing one.
Two provided callbacks are executed in a dedicated `<canvas>`/`Project`
context and both results are compared with `resemble.js`.
2018-11-06 11:26:12 +01:00
sasensi
e9135589b1 Fix mousedrag error with in front items
When dragging item A behind item B, mousedrag event was emitted on
item B instead of mousemove.
Bug introduced in fbd5eeb
Closes #1465
2018-10-20 15:59:18 +02:00
sasensi
6a3b8fc384 Minor code refactoring to try to make online build pass 2018-10-17 18:08:54 +02:00
sasensi
07d2edac74 Fix mouse interactions tests error
Mouse interactions tests only passed in `gulp load` context.
This make sure that native event classes are used in built context.
This also remove the reference to `CanvasProvider` which is not
available in built context.
Fixes bug introduced in #1570
2018-10-17 18:08:54 +02:00
Jürg Lehni
d325fce909 Travis CI: Fix error during tests 2018-10-17 17:38:42 +02:00
sasensi
3fd73f92f2 Minor code refactoring 2018-10-17 14:40:05 +02:00
sasensi
1bd67b2d9b Add mouse interaction tests
- Tests common mouse interactions scenarios to prevent regressions
when making changes. These tests are not run in node context.
- Prevent name collision between Javascript native classes and Paper.js
classes (Event and MouseEvent) by patching load.js.
- Uses a polyfill for MouseEvent which is missing in PhantomJS.
- Adds View._clearState() method and use it in tests to make sure that
each new test is started with a fresh state.
2018-10-17 14:40:05 +02:00
sapics
e3ed85e395 Fix error in single segment closed path flatten 2018-10-15 11:01:51 +02:00
Takahiro Nishino
6f2d75442c Improve color parsing for 4 characters hex code (#1565) 2018-10-14 21:44:22 +02:00
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
4c035ada36 Minor fixes in comments and tests. 2018-10-10 23:03:57 +02:00