paper 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/dist/docs/assets/js/paper.js +4565 -733
- package/dist/docs/classes/AreaText.html +720 -242
- package/dist/docs/classes/ChangeFlag.html +1 -1
- package/dist/docs/classes/Color.html +218 -21
- package/dist/docs/classes/CompoundPath.html +1146 -296
- package/dist/docs/classes/Curve.html +1 -1
- package/dist/docs/classes/CurveLocation.html +1 -1
- package/dist/docs/classes/DrawEvent.html +69 -0
- package/dist/docs/classes/Effect.html +434 -0
- package/dist/docs/classes/EffectInstance.html +304 -0
- package/dist/docs/classes/Event.html +1 -1
- package/dist/docs/classes/Gradient.html +1 -1
- package/dist/docs/classes/GradientStop.html +1 -1
- package/dist/docs/classes/Group.html +792 -243
- package/dist/docs/classes/HitResult.html +1 -1
- package/dist/docs/classes/HostItem.html +720 -242
- package/dist/docs/classes/Item.html +777 -242
- package/dist/docs/classes/Key.html +1 -1
- package/dist/docs/classes/KeyEvent.html +1 -1
- package/dist/docs/classes/Layer.html +734 -185
- package/dist/docs/classes/Matrix.html +1 -1
- package/dist/docs/classes/MouseEvent.html +1 -1
- package/dist/docs/classes/PaperScope.html +1 -1
- package/dist/docs/classes/PaperScript.html +4 -2
- package/dist/docs/classes/Path.html +1195 -252
- package/dist/docs/classes/PathItem.html +1148 -298
- package/dist/docs/classes/PathText.html +720 -242
- package/dist/docs/classes/PatternDefinition.html +367 -0
- package/dist/docs/classes/Point.html +1 -1
- package/dist/docs/classes/PointText.html +720 -242
- package/dist/docs/classes/Project.html +177 -7
- package/dist/docs/classes/Raster.html +720 -242
- package/dist/docs/classes/Rectangle.html +1 -1
- package/dist/docs/classes/Segment.html +3 -3
- package/dist/docs/classes/Shape.html +720 -242
- package/dist/docs/classes/Size.html +1 -1
- package/dist/docs/classes/StrokeProfileStop.html +346 -0
- package/dist/docs/classes/Style.html +1 -1
- package/dist/docs/classes/SymbolDefinition.html +28 -2
- package/dist/docs/classes/SymbolItem.html +720 -242
- package/dist/docs/classes/TextItem.html +720 -242
- package/dist/docs/classes/TextRange.html +1 -1
- package/dist/docs/classes/TextStory.html +1 -1
- package/dist/docs/classes/Tool.html +2 -2
- package/dist/docs/classes/ToolEvent.html +1 -1
- package/dist/docs/classes/Tween.html +1 -1
- package/dist/docs/classes/View.html +2 -2
- package/dist/docs/classes/global.html +1 -1
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/node/browser.js +15 -0
- package/dist/paper-core.js +4476 -674
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +4565 -733
- package/dist/paper-full.min.js +3 -3
- package/dist/paper-hosted.js +5111 -823
- package/dist/paper.d.ts +898 -47
- package/examples/Paperjs.org/LiveEffects.html +366 -0
- package/examples/Paperjs.org/Offsetting.html +379 -0
- package/examples/Paperjs.org/StrokeProfiles.html +706 -0
- package/examples/Scripts/Patterns.html +57 -0
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## `0.17.0`
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add `PathItem#offset(distance, options)`, which grows, shrinks or offsets
|
|
8
|
+
paths and compound paths with miter, round or bevel corners (#371).
|
|
9
|
+
- Add `PathItem#outline(options)`, which turns the stroke of a path item into a
|
|
10
|
+
filled path item, with its joins, caps and dashes (#371).
|
|
11
|
+
- Add `PathItem#dash(options)`, which cuts a stroke into its dashes as the
|
|
12
|
+
canvas draws them, as a group of open paths.
|
|
13
|
+
- Add stroke profiles, `Path#strokeProfile`: stops along a path that change
|
|
14
|
+
the width, aspect and angle of the pen that draws its stroke, see
|
|
15
|
+
`StrokeProfileStop`. Not yet supported: compound paths, `strokeScaling` off,
|
|
16
|
+
and `offset()`, boolean operations, `interpolate()` and SVG (#2505, #2506,
|
|
17
|
+
#2507).
|
|
18
|
+
- Add live effects, `Item#effects`, which change what an item draws without
|
|
19
|
+
changing the item, starting with `offset` and `outline`. `Effect` defines new
|
|
20
|
+
ones, and `Item#previewBounds` measures what they draw.
|
|
21
|
+
- Add pattern colors from a `PatternDefinition`, which tiles a raster or any
|
|
22
|
+
other item, for fills and strokes, also in SVG and JSON (#829).
|
|
23
|
+
- Add `Color#aspect` for elliptical radial gradients, and transform gradients
|
|
24
|
+
exactly with their items, also when these scale unevenly or shear (#1744).
|
|
25
|
+
- Add `Group#buffered`, which keeps a group's drawing in a canvas until the
|
|
26
|
+
group changes, for large groups that rarely do (#377).
|
|
27
|
+
- Add `Item#onDraw` and `Item#onDrawSelection`, which draw beneath an item or
|
|
28
|
+
its selection, or replace them, also as class-level handlers such as
|
|
29
|
+
`Path.onDraw`.
|
|
30
|
+
- Add `PathItem#arcAround(center, angle)` and `PathItem#arcTowards(to)`
|
|
31
|
+
(#1052).
|
|
32
|
+
- Support `options` in `PathItem#simplify()`, with `tolerance` and a range of
|
|
33
|
+
segments through `from` and `to`, as in `PathItem#smooth()` (#2501).
|
|
34
|
+
- Export and import the names and data of segments in SVG, as a
|
|
35
|
+
`data-paper-segments` attribute (#2398).
|
|
36
|
+
- Add `Project#onActivate` and `Project#onDeactivate`, also as
|
|
37
|
+
`Project.onActivate` and `Project.onDeactivate` for all projects.
|
|
38
|
+
- Pass the import attributes of `import … with { … }` in PaperScript on to the
|
|
39
|
+
loader in `options.load` of `PaperScript.execute()`.
|
|
40
|
+
- Hosted projects, see `Project#host`:
|
|
41
|
+
- Share symbol and pattern definitions between items, referred to by their
|
|
42
|
+
keys in JSON, and let scripts create new ones.
|
|
43
|
+
- Load the pixels of rasters from the host on first access.
|
|
44
|
+
- Load items in full when they move into a project with another host.
|
|
45
|
+
- Call `Item#onDraw` and `Item#onDrawSelection`, through `Project#draw()`.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Run the library in strict mode, which makes `Path#getNearestPoint()` about
|
|
50
|
+
14% and `Item#hitTest()` about 6% faster. PaperScript still runs in sloppy
|
|
51
|
+
mode.
|
|
52
|
+
- Draw items with opacity, blend modes or shadows about twice as fast (#377).
|
|
53
|
+
- Make `PaperScope#project` an accessor, so that PaperScript's `project`
|
|
54
|
+
follows the active project, as `view` does.
|
|
55
|
+
- Emit `deactivate` when the active project or tool is removed.
|
|
56
|
+
- Write the definition of symbol items to JSON as `definition` instead of
|
|
57
|
+
`symbol`, which still loads.
|
|
58
|
+
- Let hosted linked text that moves into a project with another host bring a
|
|
59
|
+
copy of its story along (#2462, #2463).
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- Fix boolean operations that could lose areas or whole results, at straight
|
|
64
|
+
curves, near-coincident crossings, curves running back and forth along a
|
|
65
|
+
line, shallow crossings and merged vertices.
|
|
66
|
+
- Measure curve lengths precisely near cusps, where `Curve#getLength()` and
|
|
67
|
+
`Path#getPointAt()` were off by up to 6%.
|
|
68
|
+
- Find the nearest point on curves that cover a lot of ground between their
|
|
69
|
+
samples, in `#getNearestPoint()` and the methods using it.
|
|
70
|
+
- Fix `PathItem#smooth()` with a negative `to` on closed paths, which threw.
|
|
71
|
+
- Fix `PathItem#arcTo()` with tiny arcs, which missed their end point.
|
|
72
|
+
- Keep the attributes of compound paths in `CompoundPath#reduce()` when a
|
|
73
|
+
single child is left.
|
|
74
|
+
- Return `false` from `CompoundPath#simplify()` without children.
|
|
75
|
+
- Keep the stripes of linear gradients across them when transforming them
|
|
76
|
+
unevenly (#1744).
|
|
77
|
+
- Export the gradients of items that keep their matrix to SVG in the
|
|
78
|
+
coordinates of their elements (#2410).
|
|
79
|
+
- Honor the `bounds` and `matrix` options of `Item#exportSVG()`.
|
|
80
|
+
- Keep `Group#isolated` and `Group#buffered` in clones.
|
|
81
|
+
- Keep the content of rasters when setting `Raster#size`.
|
|
82
|
+
- Load `new Raster(source)` from a string where there is no document, as in
|
|
83
|
+
workers.
|
|
84
|
+
- Draw the segments of selected paths again by default (#1899).
|
|
85
|
+
- Count the duration of `Item#tween()` from the first frame.
|
|
86
|
+
- PaperScript: compile `++` and `--` correctly wherever they appear, keep
|
|
87
|
+
keywords apart from replaced expressions in minified code, report the right
|
|
88
|
+
lines in stack traces on V8, and return an object from `compile()` for empty
|
|
89
|
+
code.
|
|
90
|
+
- Hosted projects: leave items that moved away out of `Project#takeChanges()`,
|
|
91
|
+
and turn off `View#autoUpdate` when setting `Project#host`.
|
|
92
|
+
- Let Angular's esbuild builder bundle Paper.js for browsers (#2035).
|
|
93
|
+
|
|
3
94
|
## `0.16.0`
|
|
4
95
|
|
|
5
96
|
### Added
|
|
@@ -33,6 +124,8 @@
|
|
|
33
124
|
new text has defaults of its own, such as a black fill without a stroke.
|
|
34
125
|
- Add `Point#values`, `Size#values` and `Rectangle#values`, which give their
|
|
35
126
|
numbers as an array, as `Matrix#values` does.
|
|
127
|
+
- Add `options.evaluate` to `PaperScript.execute()`, for hosts whose engine
|
|
128
|
+
doesn't name code from `Function()` in stack traces, such as JavaScriptCore.
|
|
36
129
|
|
|
37
130
|
### Changed
|
|
38
131
|
|
|
@@ -62,6 +155,8 @@
|
|
|
62
155
|
- Hit-test the strokes of shapes as those of their paths, which `Shape` only
|
|
63
156
|
approximated for ellipses and rounded corners, and for non-scaling strokes
|
|
64
157
|
under non-uniform matrices (#2334).
|
|
158
|
+
- Name PaperScript's url in stack traces also without source maps, and in the
|
|
159
|
+
location of its syntax errors.
|
|
65
160
|
|
|
66
161
|
## `0.15.0`
|
|
67
162
|
|