Commit graph

5609 commits

Author SHA1 Message Date
Jürg Lehni
7f496408b5 Crossing detection: Revert boundary checks
Adjust ambiguous edge case test instead
2019-06-23 10:26:47 +02:00
Jürg Lehni
b51a4bed57 Change winding quality handling when on starting point 2019-06-23 04:48:05 +02:00
Jürg Lehni
2ef8175cb8 Boolean: No need to actually check for fill 2019-06-23 04:47:34 +02:00
Jürg Lehni
192437dbe2 Boolean: Avoid winding edge cases
Stay clear from testing winding on actual segments.
Closes #1619
2019-06-23 04:19:20 +02:00
Jürg Lehni
14ce1dc011 Boolean: Correctly handle open filled paths
Closes #1647
2019-06-23 03:24:13 +02:00
Jürg Lehni
15e00e0b99 Introduce Numerical.isMachineZero()
Used in places requiring smaller epsilons for zero comparisons
2019-06-22 23:05:50 +02:00
Jürg Lehni
978cd94a9e Boolean: Add check for paths with only one segment
Closes #1351
2019-06-22 18:48:16 +02:00
Jürg Lehni
e779d24a6d Implement higher precision in getSignedDistance()
Also add unit test for overlap edge case.
Closes #1262
2019-06-22 18:42:19 +02:00
Jürg Lehni
ef8ba35911 Implement unit tests for 3ff5560c0c
Closes #1419, closes #1263
2019-06-22 18:21:47 +02:00
Jürg Lehni
3ff5560c0c Improve CurveLocation.isCrossing()
Better handles edge cases in offsetting tests
2019-06-22 17:31:36 +02:00
Jürg Lehni
f66c73e534 Fix regression in curve-intersections code
Closes #1638
2019-06-22 15:27:25 +02:00
Jürg Lehni
f89934e331 Release version 0.12.3 2019-06-22 14:40:54 +02:00
Jürg Lehni
68ea63d99e Fix JSDoc warning message 2019-06-22 14:16:49 +02:00
Samuel Asensi
b24e9b3835 Fix typescript definition issues (#1669)
Closes #1667
Closes #1664
Closes #1663
Closes #1659
2019-06-22 13:46:05 +02:00
Jürg Lehni
e5d7bafd39 Update JSDoc and add some minor doc changes 2019-06-22 13:41:05 +02:00
Jürg Lehni
bc5a361470 Fix Color change propagation again
Closes #1672
2019-06-19 22:44:54 +02:00
Dan Stucky
32aff8e895 Handle non-invertible matrices in Item#contains() (#1651) 2019-06-19 21:59:41 +02:00
Samuel Asensi
55dbf010a8 Fix item.clipMask documentation (#1673)
Text items are not currently supported as clip masks.
2019-06-19 21:56:44 +02:00
Dobes Vandermeer
7d457a866e Add docs for internalBounds (#1655) 2019-06-18 06:16:46 +02:00
Samuel Asensi
c04746aa00 Fix SVG export with Symbol (#1670)
Closes #1668
2019-06-18 06:15:20 +02:00
Jürg Lehni
3bce17815f Release version 0.12.2 2019-06-13 23:36:52 +02:00
Jürg Lehni
900a207954 Simplify agent renaming 2019-06-11 21:31:28 +02:00
Jürg Lehni
0a56c7cef0 No need to explicitly expose view
As it is enumerable on scope
2019-06-11 21:28:22 +02:00
Jürg Lehni
4857f1d73a Change jsdom -> agent.node detection 2019-06-11 21:25:11 +02:00
Jürg Lehni
44a7759219 Fix Path._addBevelJoin() edge case 2019-06-10 16:02:39 +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
Jürg Lehni
5d14559116 Fix linting error and some minor cleanup 2019-06-09 16:54:15 +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
1e2bbbdef2 Fix handling of native classes in tests again
Reverting breaking change in 10bdafa826
2019-06-09 14:34:32 +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
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
43ec699063 Fix path selection drawing with low handle size (#1600)
Closes #1327
2019-06-07 17:19:58 +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
bcfc0eb413 Release version 0.12.1 2019-06-06 00:13:07 +02:00
Jürg Lehni
c1d14bf472 Fix spelling mistakes 2019-06-06 00:04:28 +02:00
Jürg Lehni
5e64b78e40 Minor comment fixes 2019-06-05 20:03:11 +02:00
Samuel Asensi
bdc311e99f Fix node tests crash with node latest versions 2019-06-05 19:58:22 +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
9cafb6d55f Only set src attribute if it’s not empty
window.Image does not support clearing the attribute by setting it to null
2019-06-05 17:35:21 +02:00
Jürg Lehni
de36f39cbf Fix Raster#clear() to propagate content change 2019-06-05 15:31:09 +02:00
Jürg Lehni
ea91efe810 Add Raster.clear() to clear associated canvas 2019-04-11 19:38:19 +02:00
Jürg Lehni
e436d44f14 Allow new Raster(size) constructor 2019-04-11 19:38:19 +02:00
Jürg Lehni
fcfebdc43b Include Raster.context accessor 2019-04-11 19:38:19 +02:00
sapics
be4199b6eb Update copyright year to 2019 2018-12-27 16:13:01 +09:00
DD Liu
f6b8f8e309 Set preserve spaces, and insert spaces on blank lines when exporting text from paint. This makes render show the right thing. 2018-12-18 16:43:09 -05:00
sapics
5904a288e7 Fix css color parse 2018-12-14 11:44:24 +01:00
sasensi
449c5c3e6d Fix Tween#then() documentation.
Bug introduced in 9c684091f4: example
variable was renamed from `item` to `circle` in declaration but later
calls were still done with `item`.
2018-12-03 15:04:22 +01:00
sasensi
a7c2fb3ddf Improve Color.random() documentation. 2018-12-03 14:46:50 +01:00
sasensi
bbd65324bc Add typescript definition generation
This add a gulp task (`gulp docs:typescript`) to automatically generate
a typescript definition for the library. This should solve the problem
of having an out of sync type definition when we change the API.

This task takes advantage of existing JSDoc parsing to generate a
temporary file which is later formatted through a mustache template to
generate the final definition. This definition is then tested by
compiling a typescript file that use it.
The generated definition is added to the `gulp zip` task in order to be
published along with the bundled library.

So 2 new dev-dependencies are added with this change: `mustache` and
`typescript` packages. Using node and mustache to generate the
definition instead of relying on existing templating system is
motivated by a better development experience, with easier debugging
possibilities... through the usage of more modern tools.

As a side note, support of "rest parameters" (when a parameter can be
present multiple times) is added to existing JSDoc parser in order to
support this pattern on typescript side (E.g. for `Color#set()` method
which accept any sequence of parameters that is supported by `Color`
constructors).
2018-12-03 14:41:47 +01:00
Jürg Lehni
a66391678e Release version 0.12.0 2018-12-03 14:26:23 +01:00
Jürg Lehni
4a5f558057 Some minor tween example changes 2018-12-03 13:59:51 +01:00
Jürg Lehni
9c684091f4 Move Tween class to anim namespace + changes
- Change from item to object, as it can be used to tween any property on any object really
- Make _handleFrame() private
- Minor documentation tweaks
2018-12-03 12:51:31 +01:00
sasensi
a97382d1c5 Document tween update event as Tween#onUpdate. 2018-12-03 09:44:37 +01:00
sasensi
6d411e9b7f Add Tween documentation 2018-11-30 15:10:31 +01:00
sasensi
f2b6e67bcb Fix Item#tweenFrom() documentation example.
Example code was not matching example title.
2018-11-30 12:07:01 +01:00
sasensi
266cf365f5 Fix Item#tween() documentation. 2018-11-30 11:50:10 +01:00
Jürg Lehni
e52a33b9cb Fix linting errors 2018-11-29 14:10:08 +01:00
arnoson
684f504930 Implement tweening 2018-11-29 12:04:03 +01:00
Jürg Lehni
d46b6cbef4 Fix Emitter.once() 2018-11-28 11:40:17 +01:00
Jürg Lehni
b1705f628b Fix typos 2018-11-21 11:58:22 +01:00
sasensi
a4a2fb7eef Fix various documentation problems
- typos in comments
- wrong or missing types
- missing default values
2018-11-21 11:27:51 +01:00
sasensi
b363a5cc95 Remove Line from documentation
Line class was not displayed in online documentation but it was parsed
and a file was created for it because it lacked a @private JSDoc tag.
2018-11-21 11:21:51 +01:00
sasensi
dd2c15ac83 Add documentation for Color.random() 2018-11-21 11:18:02 +01:00
sapics
531479c0a0 Add param type in raster method
Add param type in Raster#getPixel and Raster#setPixel
2018-11-20 08:44:38 +09:00
sasensi
ef7beacd8b Fix several return values documentation 2018-11-17 09:37:06 +01:00
sasensi
12731f2fd1 Fix typo in Raster#getCanvas documentation 2018-11-16 18:58:18 +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
sapics
d8f9eb8890 Replace http to https in comment
http://www.w3.org/TR/SVG/* to https://www.w3.org/TR/SVG/*
2018-11-14 11:24:04 +01:00
sapics
c219bb7345 Replace http to https in comment 2018-11-14 11:22:29 +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
8202f78453 Fix typo in Color#convert documentation 2018-11-13 10:12:59 +01:00
sasensi
1462178799 Fix typo in Path(pathData) documentation
Empty parameter was resulting in `Path(pathData)` being documented as
`Path(, pathData)` with an empty first parameter.
2018-11-13 09:52:19 +01:00
sasensi
910aecb7e5 Fix CurveLocation#distance documentation
@see tag was pointing to an inherited method which is not compatible
with current jsdoc parser implementation.
Problem is resolved by making reference point to the parent class
owning the method.
2018-11-12 16:44:36 +01:00
sasensi
8b33eccd52 Fix beans documentation links
Several documentation "see also" links concerning beans were broken
because they were referenced as `ClassName#getProperty()` instead of
`ClassName#property`.
2018-11-12 16:38:34 +01:00
sasensi
0b52720bdf Fix CompoundPath#lastSegment documentation 2018-11-12 16:27:23 +01:00
sasensi
6301aeb82d Fix Raster#context documented type 2018-11-12 16:20:39 +01:00
sasensi
4f545d243b Fix unexisting type Symbol in documentation 2018-11-12 16:18:05 +01:00
sasensi
bb63310578 Fix CurveLocation#index documented type 2018-11-12 16:12:01 +01:00
sasensi
df109ab096 Fix typo in PathItem documentation
PathItem was misspelled PahtItem, breaking documentation links.
2018-11-12 16:08:04 +01:00
sasensi
d3f617b98e Fix Path#divide() documentation
Divide operation was described as subtract & subtract instead of
subtract & intersect.
2018-11-09 14:24:04 +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
DD
9d4ab1e38f Default raster smoothing to false for Scratch 2018-11-05 15:10:56 -05:00
sasensi
c44f56d52f Fix Rectangle documentation
Add missing return values in Rectangle boolean operations.
Closes #1399
2018-11-05 08:34:50 +01:00
DD
b1dd6fbb87 Match spacing 2018-10-25 15:31:52 -04:00
DD
f3991edc0a Fix RTL 2018-10-25 15:15:12 -04:00
DD
e893cb1325 Clean up/ 2018-10-25 14:19:45 -04:00
DD
893f85bdfe rename the bound type and fix cache flags 2018-10-25 14:19:45 -04:00
DD
f85e3a7947 Use different bounds for different situations 2018-10-25 14:19:45 -04:00