mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Prebuilt module for commit f5616781c5
This commit is contained in:
parent
f999562ee4
commit
90d0fcf7e3
51 changed files with 3780 additions and 2906 deletions
|
@ -13,5 +13,6 @@
|
|||
- Justin Ridgewell <justinridgewell@gmail.com>
|
||||
- Andrew Wagenheim <abwagenheim@gmail.com>
|
||||
- Scott Kieronski <baroes0239@gmail.com>
|
||||
- DD Liu <liudi@media.mit.edu>
|
||||
- Samuel Asensi <asensi.samuel@gmail.com>
|
||||
- Takahiro Nishino <sapics.dev@gmail.com>
|
||||
|
|
60
CHANGELOG.md
60
CHANGELOG.md
|
@ -1,65 +1,5 @@
|
|||
# Change Log
|
||||
|
||||
## `0.12.15`
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix NPM installation problem with `husky` introduced in `v0.12.13`
|
||||
|
||||
## `0.12.13`
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix faulty positioning regression in `Item#rasterize()` (#1905).
|
||||
|
||||
## `0.12.12`
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix installation problems on Windows by switching from NPM to Yarn for development (#1833).
|
||||
|
||||
### Changed
|
||||
|
||||
- Change `Item#raster({ resolution, insert })` to receive options object, while remaining backward compatible.
|
||||
- Change `Raster#smoothing` to support the values `'low'`, `'medium'`, `'high'`
|
||||
and `'off'`. Setting to a boolean value is still supported, translating `false` →
|
||||
`'off'` and `true` → `'low'`.
|
||||
|
||||
### Added
|
||||
|
||||
- Allow reusing of raster items in `Item#rasterize({ raster })`: By providing an existing raster in `options.raster`, the raster and maybe even its underlying canvas can be reused, as long as the rasterized size doesn't change between rasterizations. This allows for big performance improvements.
|
||||
|
||||
## `0.12.11`
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix installation through Yarn (#1831).
|
||||
|
||||
## `0.12.9`
|
||||
|
||||
### Added
|
||||
|
||||
- Export `CanvasProvider` to allow experimenting with
|
||||
https://www.npmjs.com/package/canvaskit-wasm on Node.js
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix `Path.strokeBounds` that was incorrect for certain paths (#1824).
|
||||
- Fix Gulp 3 issues to be able to run Travis CI tests on Node.js 10, 12, 13 and
|
||||
14.
|
||||
|
||||
## `0.12.8`
|
||||
|
||||
### Fixed
|
||||
|
||||
- TypeScript: Fix returned instance type (#1796).
|
||||
- Fix `Path#strokeBounds` for open paths (#1817).
|
||||
- Fix animation progress handling in `Tween.update()`.
|
||||
- Fix setting `Item#scaling` to a new value after it was set to zero (#1816).
|
||||
- SVG Import: Fully support SVG strings with leading line-breaks (#1813).
|
||||
- Docs: Improve `Raster#initialize(object)` documentation (#1815, #1782).
|
||||
- Docs: Fix `Item#getItem(options)` documentation.
|
||||
|
||||
## `0.12.7`
|
||||
|
||||
### Fixed
|
||||
|
|
56
README.md
56
README.md
|
@ -1,4 +1,10 @@
|
|||
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting [![Build Status](https://travis-ci.org/paperjs/paper.js.svg?branch=develop)](https://travis-ci.org/paperjs/paper.js) [![NPM](https://img.shields.io/npm/v/paper.svg)](https://www.npmjs.com/package/paper)
|
||||
# Scratch's fork of Paper.js [![Build Status](https://circleci.com/gh/LLK/paper.js.svg?style=shield)](https://app.circleci.com/pipelines/github/LLK/paper.js?branch=develop) [![NPM](https://img.shields.io/npm/v/@scratch/paper.svg)](https://www.npmjs.com/package/@scratch/paper)
|
||||
|
||||
This is a fork of Paper.js for use in Scratch. Please do not contact the Paper.js authors to support this fork.
|
||||
|
||||
_Original README.md below_
|
||||
|
||||
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting
|
||||
|
||||
If you want to work with Paper.js, simply download the latest "stable" version
|
||||
from [http://paperjs.org/download/](http://paperjs.org/download/)
|
||||
|
@ -64,9 +70,8 @@ different projects:
|
|||
Homebrew is recommended on macOS also if you intend to install Paper.js with
|
||||
rendering to the Canvas on Node.js, as described in the next paragraph.
|
||||
|
||||
For Linux, see <https://nodejs.org/download/> to locate 32-bit and 64-bit
|
||||
Node.js binaries as well as sources, or use NVM, as described in the paragraph
|
||||
above.
|
||||
For Linux, see <https://nodejs.org/download/> to locate 32-bit and 64-bit Node.js
|
||||
binaries as well as sources, or use NVM, as described in the paragraph above.
|
||||
|
||||
### Installing Paper.js Using NPM
|
||||
|
||||
|
@ -168,20 +173,21 @@ run:
|
|||
|
||||
### Setting Up For Building
|
||||
|
||||
Paper.js uses [Gulp.js](https://gulpjs.com/) for building, and has a couple of
|
||||
dependencies as NPM modules. Read the chapter [Installing Node.js and
|
||||
NPM](#installing-nodejs-and-npm) if you still need to install these.
|
||||
|
||||
Due to a conflict in Gulp 3 that could only be resolved using package
|
||||
resolution, we recently switched from NPM to `yarn` for development, which also
|
||||
needs to be installed now. See
|
||||
[Installing Yarn](https://classic.yarnpkg.com/en/docs/install/) for details.
|
||||
As of 2016, Paper.js uses [Gulp.js](https://gulpjs.com/) for building, and has a
|
||||
couple of dependencies as NPM modules. Read the chapter [Installing
|
||||
Node.js and NPM](#installing-nodejs-and-npm) if you still need to
|
||||
install these.
|
||||
|
||||
In order to be able to build Paper.js, after checking out the repository, paper
|
||||
has dependencies that need to be installed. Install them by issuing the
|
||||
following commands from the Paper.js directory:
|
||||
|
||||
yarn install
|
||||
npm install
|
||||
|
||||
It is also recommended to install Gulp.js globally, so you can easier execute
|
||||
the build commands from anywhere in the command line:
|
||||
|
||||
npm install -g gulp
|
||||
|
||||
### Building the Library
|
||||
|
||||
|
@ -189,7 +195,7 @@ The Paper.js sources are distributed across many separate files, organised in
|
|||
subfolders inside the `src` folder. To compile them all into distributable
|
||||
files, you can run the `build` task:
|
||||
|
||||
yarn build
|
||||
gulp build
|
||||
|
||||
You will then find the built library files inside the `dist` folder, named
|
||||
`paper-full.js` and `paper-core.js`, along with their minified versions. Read
|
||||
|
@ -207,11 +213,11 @@ library.
|
|||
This means you can switch between loading from sources and loading a built
|
||||
library simply by running.
|
||||
|
||||
yarn load
|
||||
gulp load
|
||||
|
||||
And to go back to a built library
|
||||
|
||||
yarn build
|
||||
gulp build
|
||||
|
||||
Note that your PaperScripts examples do not need to change, they can keep
|
||||
loading `dist/paper-full.js`, which will always do the right thing. Note also
|
||||
|
@ -221,7 +227,11 @@ that `src/load.js` handles both browsers and Node.js, as supported by Prepro.js.
|
|||
|
||||
Create a final zipped distribution file inside the `dist` folder:
|
||||
|
||||
yarn dist
|
||||
gulp dist
|
||||
|
||||
And since `dist` is the default task, this is the same:
|
||||
|
||||
gulp
|
||||
|
||||
### Branch structure
|
||||
|
||||
|
@ -232,7 +242,7 @@ only merged into [`master`](https://github.com/paperjs/paper.js/tree/master)
|
|||
when a new release occurs.
|
||||
|
||||
As of version `0.9.26`, the `dist` folder is excluded on all branches, and the
|
||||
building is now part of the `yarn publish` process by way of the `prepublish`
|
||||
building is now part of the `npm publish` process by way of the `prepublish`
|
||||
script.
|
||||
|
||||
We also offer prebuilt versions of the latest state of the `develop` branch on
|
||||
|
@ -244,7 +254,7 @@ and [`prebuilt/dist`](https://github.com/paperjs/paper.js/tree/prebuilt/dist).
|
|||
Similarly to building the library, you can run the `docs` task to build the
|
||||
documentation:
|
||||
|
||||
yarn docs
|
||||
gulp docs
|
||||
|
||||
Your docs will then be located at `dist/docs`.
|
||||
|
||||
|
@ -262,20 +272,20 @@ CORS restrictions. In order to run the browser based tests on Chrome, you need
|
|||
to run a local web-server through Gulp.js. The following command will handle it
|
||||
for you, and will also open the browser at the right address straight away:
|
||||
|
||||
yarn test:browser
|
||||
gulp test:browser
|
||||
|
||||
You can also run the unit tests through PhantomJS in Gulp directly on the
|
||||
command line:
|
||||
|
||||
yarn test:phantom
|
||||
gulp test:phantom
|
||||
|
||||
To test the Node.js version of Paper.js, use this command:
|
||||
|
||||
yarn test:node
|
||||
gulp test:node
|
||||
|
||||
And to test both the PhantomJS and Node.js environments together, simply run:
|
||||
|
||||
yarn test
|
||||
gulp test
|
||||
|
||||
### Contributing [![Open Source Helpers](https://www.codetriage.com/paperjs/paper.js/badges/users.svg)](https://www.codetriage.com/paperjs/paper.js)
|
||||
|
||||
|
|
2
dist/.npmignore
vendored
2
dist/.npmignore
vendored
|
@ -1,2 +0,0 @@
|
|||
paperjs.zip
|
||||
serverdocs
|
358
dist/docs/assets/js/paper.js
vendored
358
dist/docs/assets/js/paper.js
vendored
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Paper.js v0.12.15-develop - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* Paper.js v0.12.7 - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
||||
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Mon Mar 22 17:03:39 2021 +0100
|
||||
* Date: Thu Dec 1 12:02:03 2022 -0800
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -33,7 +33,7 @@
|
|||
var paper = function(self, undefined) {
|
||||
|
||||
self = self || require('./node/self.js');
|
||||
var window = self.window,
|
||||
var window = self.window ? self.window : self,
|
||||
document = self.document;
|
||||
|
||||
var Base = new function() {
|
||||
|
@ -821,7 +821,7 @@ var PaperScope = Base.extend({
|
|||
}
|
||||
},
|
||||
|
||||
version: "0.12.15-develop",
|
||||
version: "0.12.7",
|
||||
|
||||
getView: function() {
|
||||
var project = this.project;
|
||||
|
@ -3455,7 +3455,8 @@ new function() {
|
|||
}, Base.each({
|
||||
getStrokeBounds: { stroke: true },
|
||||
getHandleBounds: { handle: true },
|
||||
getInternalBounds: { internal: true }
|
||||
getInternalBounds: { internal: true },
|
||||
getDrawnBounds: { stroke: true, drawnTextBounds: true },
|
||||
},
|
||||
function(options, key) {
|
||||
this[key] = function(matrix) {
|
||||
|
@ -3512,6 +3513,7 @@ new function() {
|
|||
return [
|
||||
options.stroke ? 1 : 0,
|
||||
options.handle ? 1 : 0,
|
||||
options.drawnTextBounds? 1 : 0,
|
||||
internal ? 1 : 0
|
||||
].join('');
|
||||
},
|
||||
|
@ -3660,25 +3662,15 @@ new function() {
|
|||
var rotation = this.getRotation(),
|
||||
decomposed = this._decomposed,
|
||||
matrix = new Matrix(),
|
||||
isZero = Numerical.isZero;
|
||||
if (isZero(current.x) || isZero(current.y)) {
|
||||
matrix.translate(decomposed.translation);
|
||||
if (rotation) {
|
||||
matrix.rotate(rotation);
|
||||
}
|
||||
matrix.scale(scaling.x, scaling.y);
|
||||
this._matrix.set(matrix);
|
||||
} else {
|
||||
var center = this.getPosition(true);
|
||||
matrix.translate(center);
|
||||
if (rotation)
|
||||
matrix.rotate(rotation);
|
||||
matrix.scale(scaling.x / current.x, scaling.y / current.y);
|
||||
if (rotation)
|
||||
matrix.rotate(-rotation);
|
||||
matrix.translate(center.negate());
|
||||
this.transform(matrix);
|
||||
}
|
||||
center = this.getPosition(true);
|
||||
matrix.translate(center);
|
||||
if (rotation)
|
||||
matrix.rotate(rotation);
|
||||
matrix.scale(scaling.x / current.x, scaling.y / current.y);
|
||||
if (rotation)
|
||||
matrix.rotate(-rotation);
|
||||
matrix.translate(center.negate());
|
||||
this.transform(matrix);
|
||||
if (decomposed) {
|
||||
decomposed.scaling = scaling;
|
||||
this._decomposed = decomposed;
|
||||
|
@ -3692,7 +3684,7 @@ new function() {
|
|||
|
||||
setMatrix: function() {
|
||||
var matrix = this._matrix;
|
||||
matrix.set.apply(matrix, arguments);
|
||||
matrix.initialize.apply(matrix, arguments);
|
||||
},
|
||||
|
||||
getGlobalMatrix: function(_dontClone) {
|
||||
|
@ -3891,45 +3883,28 @@ new function() {
|
|||
this.setName(name);
|
||||
},
|
||||
|
||||
rasterize: function(arg0, arg1) {
|
||||
var resolution,
|
||||
insert,
|
||||
raster;
|
||||
if (Base.isPlainObject(arg0)) {
|
||||
resolution = arg0.resolution;
|
||||
insert = arg0.insert;
|
||||
raster = arg0.raster;
|
||||
} else {
|
||||
resolution = arg0;
|
||||
insert = arg1;
|
||||
}
|
||||
if (!raster) {
|
||||
raster = new Raster(Item.NO_INSERT);
|
||||
}
|
||||
var bounds = this.getStrokeBounds(),
|
||||
rasterize: function(resolution, insert, boundRect) {
|
||||
var bounds = boundRect ? boundRect : this.getStrokeBounds(),
|
||||
scale = (resolution || this.getView().getResolution()) / 72,
|
||||
topLeft = bounds.getTopLeft().floor(),
|
||||
bottomRight = bounds.getBottomRight().ceil(),
|
||||
boundsSize = new Size(bottomRight.subtract(topLeft)),
|
||||
rasterSize = boundsSize.multiply(scale);
|
||||
raster.setSize(rasterSize, true);
|
||||
|
||||
if (!rasterSize.isZero()) {
|
||||
var ctx = raster.getContext(true),
|
||||
size = new Size(bottomRight.subtract(topLeft)),
|
||||
raster = new Raster(Item.NO_INSERT);
|
||||
if (!size.isZero()) {
|
||||
var canvas = CanvasProvider.getCanvas(size.multiply(scale)),
|
||||
ctx = canvas.getContext('2d'),
|
||||
matrix = new Matrix().scale(scale).translate(topLeft.negate());
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
ctx.save();
|
||||
matrix.applyToContext(ctx);
|
||||
this.draw(ctx, new Base({ matrices: [matrix] }));
|
||||
ctx.restore();
|
||||
raster.setCanvas(canvas);
|
||||
}
|
||||
raster._matrix.set(
|
||||
new Matrix()
|
||||
.translate(topLeft.add(boundsSize.divide(2)))
|
||||
.scale(1 / scale)
|
||||
);
|
||||
if (insert === undefined || insert) {
|
||||
raster.transform(new Matrix().translate(topLeft.add(size.divide(2)))
|
||||
.scale(1 / scale));
|
||||
if (insert === undefined || insert)
|
||||
raster.insertAbove(this);
|
||||
}
|
||||
return raster;
|
||||
},
|
||||
|
||||
|
@ -4649,14 +4624,14 @@ new function() {
|
|||
}
|
||||
}), {
|
||||
|
||||
_setStyles: function(ctx, param, viewMatrix) {
|
||||
_setStyles: function(ctx, param, viewMatrix, strokeMatrix) {
|
||||
var style = this._style,
|
||||
matrix = this._matrix;
|
||||
if (style.hasFill()) {
|
||||
ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix);
|
||||
ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix, strokeMatrix);
|
||||
}
|
||||
if (style.hasStroke()) {
|
||||
ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix);
|
||||
ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix, strokeMatrix);
|
||||
ctx.lineWidth = style.getStrokeWidth();
|
||||
var strokeJoin = style.getStrokeJoin(),
|
||||
strokeCap = style.getStrokeCap(),
|
||||
|
@ -4808,6 +4783,7 @@ new function() {
|
|||
half = size / 2;
|
||||
ctx.strokeStyle = ctx.fillStyle = color
|
||||
? color.toCanvasStyle(ctx) : '#009dec';
|
||||
ctx.lineWidth=2.5;
|
||||
if (itemSelected)
|
||||
this._drawSelected(ctx, mx, selectionItems);
|
||||
if (positionSelected) {
|
||||
|
@ -5200,7 +5176,7 @@ var Shape = Item.extend({
|
|||
ctx.closePath();
|
||||
}
|
||||
if (!dontPaint && (hasFill || hasStroke)) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
if (hasFill) {
|
||||
ctx.fill(style.getFillRule());
|
||||
ctx.shadowColor = 'rgba(0,0,0,0)';
|
||||
|
@ -5363,7 +5339,7 @@ var Raster = Item.extend({
|
|||
source: null
|
||||
},
|
||||
_prioritize: ['crossOrigin'],
|
||||
_smoothing: 'low',
|
||||
_smoothing: false,
|
||||
beans: true,
|
||||
|
||||
initialize: function Raster(source, position) {
|
||||
|
@ -5421,23 +5397,20 @@ var Raster = Item.extend({
|
|||
this, 'setSize');
|
||||
},
|
||||
|
||||
setSize: function(_size, _clear) {
|
||||
setSize: function() {
|
||||
var size = Size.read(arguments);
|
||||
if (!size.equals(this._size)) {
|
||||
if (size.width > 0 && size.height > 0) {
|
||||
var element = !_clear && this.getElement();
|
||||
var element = this.getElement();
|
||||
this._setImage(CanvasProvider.getCanvas(size));
|
||||
if (element) {
|
||||
if (element)
|
||||
this.getContext(true).drawImage(element, 0, 0,
|
||||
size.width, size.height);
|
||||
}
|
||||
} else {
|
||||
if (this._canvas)
|
||||
CanvasProvider.release(this._canvas);
|
||||
this._size = size.clone();
|
||||
}
|
||||
} else if (_clear) {
|
||||
this.clear();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -5590,9 +5563,7 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSmoothing: function(smoothing) {
|
||||
this._smoothing = typeof smoothing === 'string'
|
||||
? smoothing
|
||||
: smoothing ? 'low' : 'off';
|
||||
this._smoothing = smoothing;
|
||||
this._changed(257);
|
||||
},
|
||||
|
||||
|
@ -5605,8 +5576,16 @@ var Raster = Item.extend({
|
|||
getSubCanvas: function() {
|
||||
var rect = Rectangle.read(arguments),
|
||||
ctx = CanvasProvider.getContext(rect.getSize());
|
||||
ctx.drawImage(this.getCanvas(), rect.x, rect.y,
|
||||
rect.width, rect.height, 0, 0, rect.width, rect.height);
|
||||
var clippedStartX = Math.max(0, rect.x);
|
||||
var clippedStartY = Math.max(0, rect.y);
|
||||
var clippedEndX = Math.min(this.getCanvas().width, rect.x + rect.width);
|
||||
var clippedEndY = Math.min(this.getCanvas().height, rect.y + rect.height);
|
||||
ctx.drawImage(this.getCanvas(),
|
||||
clippedStartX, clippedStartY,
|
||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY,
|
||||
clippedStartX - rect.x, clippedStartY - rect.y,
|
||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY
|
||||
);
|
||||
return ctx.canvas;
|
||||
},
|
||||
|
||||
|
@ -5731,16 +5710,11 @@ var Raster = Item.extend({
|
|||
rect.width, rect.height);
|
||||
},
|
||||
|
||||
putImageData: function(data ) {
|
||||
setImageData: function(data ) {
|
||||
var point = Point.read(arguments, 1);
|
||||
this.getContext(true).putImageData(data, point.x, point.y);
|
||||
},
|
||||
|
||||
setImageData: function(data) {
|
||||
this.setSize(data);
|
||||
this.getContext(true).putImageData(data, 0, 0);
|
||||
},
|
||||
|
||||
_getBounds: function(matrix, options) {
|
||||
var rect = new Rectangle(this._size).setCenter(0, 0);
|
||||
return matrix ? matrix._transformBounds(rect) : rect;
|
||||
|
@ -5767,12 +5741,8 @@ var Raster = Item.extend({
|
|||
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
|
||||
var smoothing = this._smoothing,
|
||||
disabled = smoothing === 'off';
|
||||
DomElement.setPrefixed(
|
||||
ctx,
|
||||
disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality',
|
||||
disabled ? false : smoothing
|
||||
ctx, 'imageSmoothingEnabled', this._smoothing
|
||||
);
|
||||
|
||||
ctx.drawImage(element,
|
||||
|
@ -6842,13 +6812,13 @@ statics: {
|
|||
}
|
||||
|
||||
padding /= 2;
|
||||
var minPad = min[coord] + padding,
|
||||
maxPad = max[coord] - padding;
|
||||
var minPad = min[coord] - padding,
|
||||
maxPad = max[coord] + padding;
|
||||
if ( v0 < minPad || v1 < minPad || v2 < minPad || v3 < minPad ||
|
||||
v0 > maxPad || v1 > maxPad || v2 > maxPad || v3 > maxPad) {
|
||||
if (v1 < v0 != v1 < v3 && v2 < v0 != v2 < v3) {
|
||||
add(v0, 0);
|
||||
add(v3, 0);
|
||||
add(v0, padding);
|
||||
add(v3, padding);
|
||||
} else {
|
||||
var a = 3 * (v1 - v2) - v0 + v3,
|
||||
b = 2 * (v0 + v2) - 4 * v1,
|
||||
|
@ -9172,8 +9142,8 @@ var Path = PathItem.extend({
|
|||
strokePadding = tolerancePadding,
|
||||
join, cap, miterLimit,
|
||||
area, loc, res,
|
||||
hitStroke = options.stroke && style.hasStroke(),
|
||||
hitFill = options.fill && style.hasFill(),
|
||||
hitStroke = options.stroke && (style.hasStroke() || options.hitUnstrokedPaths),
|
||||
hitFill = options.fill && (style.hasFill() || options.hitUnfilledPaths),
|
||||
hitCurves = options.curves,
|
||||
strokeRadius = hitStroke
|
||||
? style.getStrokeWidth() / 2
|
||||
|
@ -9361,12 +9331,10 @@ var Path = PathItem.extend({
|
|||
}),
|
||||
new function() {
|
||||
|
||||
function drawHandles(ctx, segments, matrix, size) {
|
||||
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||
if (size <= 0) return;
|
||||
|
||||
var half = size / 2,
|
||||
miniSize = size - 2,
|
||||
miniHalf = half - 1,
|
||||
coords = new Array(6),
|
||||
pX, pY;
|
||||
|
||||
|
@ -9377,10 +9345,12 @@ new function() {
|
|||
ctx.beginPath();
|
||||
ctx.moveTo(pX, pY);
|
||||
ctx.lineTo(hX, hY);
|
||||
ctx.moveTo(hX - half, hY);
|
||||
ctx.lineTo(hX, hY + half);
|
||||
ctx.lineTo(hX + half, hY);
|
||||
ctx.lineTo(hX, hY - half);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9390,17 +9360,19 @@ new function() {
|
|||
segment._transformCoordinates(matrix, coords);
|
||||
pX = coords[0];
|
||||
pY = coords[1];
|
||||
if (selection & 2)
|
||||
if (selection & 2 && !isFullySelected)
|
||||
drawHandle(2);
|
||||
if (selection & 4)
|
||||
if (selection & 4 && !isFullySelected)
|
||||
drawHandle(4);
|
||||
ctx.fillRect(pX - half, pY - half, size, size);
|
||||
if (miniSize > 0 && !(selection & 1)) {
|
||||
var fillStyle = ctx.fillStyle;
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillRect(pX - miniHalf, pY - miniHalf, miniSize, miniSize);
|
||||
ctx.fillStyle = fillStyle;
|
||||
ctx.beginPath();
|
||||
ctx.arc(pX, pY, half, 0, Math.PI * 2, true);
|
||||
ctx.stroke();
|
||||
var fillStyle = ctx.fillStyle;
|
||||
if (!(selection & 1)) {
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||
}
|
||||
ctx.fill();
|
||||
ctx.fillStyle = fillStyle;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9486,7 +9458,7 @@ new function() {
|
|||
}
|
||||
|
||||
if (!dontPaint && (hasFill || hasStroke)) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
if (hasFill) {
|
||||
ctx.fill(style.getFillRule());
|
||||
ctx.shadowColor = 'rgba(0,0,0,0)';
|
||||
|
@ -9500,6 +9472,7 @@ new function() {
|
|||
length = flattener.length,
|
||||
from = -style.getDashOffset(), to,
|
||||
i = 0;
|
||||
from = from % length;
|
||||
while (from > 0) {
|
||||
from -= getOffset(i--) + getOffset(i--);
|
||||
}
|
||||
|
@ -9520,7 +9493,8 @@ new function() {
|
|||
ctx.beginPath();
|
||||
drawSegments(ctx, this, matrix);
|
||||
ctx.stroke();
|
||||
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize);
|
||||
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize,
|
||||
this.isFullySelected());
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -10240,7 +10214,7 @@ var CompoundPath = PathItem.extend({
|
|||
|
||||
_hitTestChildren: function _hitTestChildren(point, options, viewMatrix) {
|
||||
return _hitTestChildren.base.call(this, point,
|
||||
options.class === Path || options.type === 'path' ? options
|
||||
options.class === Path || options.type === 'path' || options.hitUnfilledPaths ? options
|
||||
: Base.set({}, options, { fill: false }),
|
||||
viewMatrix);
|
||||
},
|
||||
|
@ -10256,7 +10230,7 @@ var CompoundPath = PathItem.extend({
|
|||
children[i].draw(ctx, param, strokeMatrix);
|
||||
|
||||
if (!param.clip) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
var style = this._style;
|
||||
if (style.hasFill()) {
|
||||
ctx.fill(style.getFillRule());
|
||||
|
@ -11628,6 +11602,11 @@ var PointText = TextItem.extend({
|
|||
},
|
||||
|
||||
_getBounds: function(matrix, options) {
|
||||
var rect = options.drawnTextBounds ? this._getDrawnTextSize() : this._getMeasuredTextSize();
|
||||
return matrix ? matrix._transformBounds(rect, rect) : rect;
|
||||
},
|
||||
|
||||
_getMeasuredTextSize: function() {
|
||||
var style = this._style,
|
||||
lines = this._lines,
|
||||
numLines = lines.length,
|
||||
|
@ -11637,10 +11616,67 @@ var PointText = TextItem.extend({
|
|||
x = 0;
|
||||
if (justification !== 'left')
|
||||
x -= width / (justification === 'center' ? 2: 1);
|
||||
var rect = new Rectangle(x,
|
||||
return new Rectangle(x,
|
||||
numLines ? - 0.75 * leading : 0,
|
||||
width, numLines * leading);
|
||||
return matrix ? matrix._transformBounds(rect, rect) : rect;
|
||||
},
|
||||
|
||||
_getDrawnTextSize: function() {
|
||||
var style = this._style;
|
||||
var lines = this._lines;
|
||||
var numLines = lines.length;
|
||||
var leading = style.getLeading();
|
||||
var justification = style.getJustification();
|
||||
|
||||
var svg = SvgElement.create('svg', {
|
||||
version: '1.1',
|
||||
xmlns: SvgElement.svg
|
||||
});
|
||||
var node = SvgElement.create('text');
|
||||
node.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
||||
svg.appendChild(node);
|
||||
for (var i = 0; i < numLines; i++) {
|
||||
var tspanNode = SvgElement.create('tspan', {
|
||||
x: '0',
|
||||
dy: i === 0 ? '0' : leading + 'px'
|
||||
});
|
||||
tspanNode.textContent = this._lines[i];
|
||||
node.appendChild(tspanNode);
|
||||
}
|
||||
|
||||
var element = document.createElement('span');
|
||||
element.style.visibility = ('hidden');
|
||||
element.style.whiteSpace = 'pre';
|
||||
element.style.fontSize = this.fontSize + 'px';
|
||||
element.style.fontFamily = this.font;
|
||||
element.style.lineHeight = this.leading / this.fontSize;
|
||||
|
||||
var bbox;
|
||||
try {
|
||||
element.appendChild(svg);
|
||||
document.body.appendChild(element);
|
||||
bbox = svg.getBBox();
|
||||
} finally {
|
||||
document.body.removeChild(element);
|
||||
}
|
||||
|
||||
var halfStrokeWidth = this.strokeWidth / 2;
|
||||
var width = bbox.width + (halfStrokeWidth * 2);
|
||||
var height = bbox.height + (halfStrokeWidth * 2);
|
||||
var x = bbox.x - halfStrokeWidth;
|
||||
var y = bbox.y - halfStrokeWidth;
|
||||
|
||||
if (justification !== 'left') {
|
||||
var eltWidth = this.getView().getTextWidth(style.getFontStyle(), lines);
|
||||
x -= eltWidth / (justification === 'center' ? 2: 1);
|
||||
}
|
||||
|
||||
return new Rectangle(x, y, width + 1, Math.max(height, numLines * leading));
|
||||
},
|
||||
|
||||
_hitTestSelf: function(point, options) {
|
||||
if (options.fill && (this.hasFill() || options.hitUnfilledPaths) && this._contains(point))
|
||||
return new HitResult('fill', this);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -12112,8 +12148,9 @@ var Color = Base.extend(new function() {
|
|||
+ components.join(',') + ')';
|
||||
},
|
||||
|
||||
toCanvasStyle: function(ctx, matrix) {
|
||||
if (this._canvasStyle)
|
||||
toCanvasStyle: function(ctx, matrix, strokeMatrix) {
|
||||
var strokeMayChange = this._type === 'gradient' && strokeMatrix;
|
||||
if (this._canvasStyle && !strokeMayChange)
|
||||
return this._canvasStyle;
|
||||
if (this._type !== 'gradient')
|
||||
return this._canvasStyle = this.toCSS();
|
||||
|
@ -12131,6 +12168,12 @@ var Color = Base.extend(new function() {
|
|||
if (highlight)
|
||||
highlight = inverse._transformPoint(highlight);
|
||||
}
|
||||
if (strokeMatrix) {
|
||||
origin = strokeMatrix._transformPoint(origin);
|
||||
destination = strokeMatrix._transformPoint(destination);
|
||||
if (highlight)
|
||||
highlight = strokeMatrix._transformPoint(highlight);
|
||||
}
|
||||
if (gradient._radial) {
|
||||
var radius = destination.getDistance(origin);
|
||||
if (highlight) {
|
||||
|
@ -12152,7 +12195,8 @@ var Color = Base.extend(new function() {
|
|||
offset == null ? i / (l - 1) : offset,
|
||||
stop._color.toCanvasStyle());
|
||||
}
|
||||
return this._canvasStyle = canvasGradient;
|
||||
if (!strokeMayChange) this._canvasStyle = canvasGradient;
|
||||
return canvasGradient;
|
||||
},
|
||||
|
||||
transform: function(matrix) {
|
||||
|
@ -13168,7 +13212,7 @@ var View = Base.extend(Emitter, {
|
|||
|
||||
setMatrix: function() {
|
||||
var matrix = this._matrix;
|
||||
matrix.set.apply(matrix, arguments);
|
||||
matrix.initialize.apply(matrix, arguments);
|
||||
},
|
||||
|
||||
transform: function(matrix) {
|
||||
|
@ -14062,7 +14106,7 @@ var Tween = Base.extend(Emitter, {
|
|||
_class: 'Tween',
|
||||
|
||||
statics: {
|
||||
easings: new Base({
|
||||
easings: {
|
||||
linear: function(t) {
|
||||
return t;
|
||||
},
|
||||
|
@ -14122,7 +14166,7 @@ var Tween = Base.extend(Emitter, {
|
|||
? 16 * t * t * t * t * t
|
||||
: 1 + 16 * (--t) * t * t * t * t;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function Tween(object, from, to, duration, easing, start) {
|
||||
|
@ -14168,7 +14212,7 @@ var Tween = Base.extend(Emitter, {
|
|||
|
||||
update: function(progress) {
|
||||
if (this.running) {
|
||||
if (progress >= 1) {
|
||||
if (progress > 1) {
|
||||
progress = 1;
|
||||
this.running = false;
|
||||
}
|
||||
|
@ -14190,15 +14234,15 @@ var Tween = Base.extend(Emitter, {
|
|||
this._setProperty(this._parsedKeys[key], value);
|
||||
}
|
||||
|
||||
if (!this.running && this._then) {
|
||||
this._then(this.object);
|
||||
}
|
||||
if (this.responds('update')) {
|
||||
this.emit('update', new Base({
|
||||
progress: progress,
|
||||
factor: factor
|
||||
}));
|
||||
}
|
||||
if (!this.running && this._then) {
|
||||
this._then(this.object);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
@ -14328,7 +14372,7 @@ var Http = {
|
|||
}
|
||||
};
|
||||
|
||||
var CanvasProvider = Base.exports.CanvasProvider = {
|
||||
var CanvasProvider = {
|
||||
canvases: [],
|
||||
|
||||
getCanvas: function(width, height) {
|
||||
|
@ -14896,7 +14940,7 @@ new function() {
|
|||
return SvgElement.create('use', attrs, formatter);
|
||||
}
|
||||
|
||||
function exportGradient(color) {
|
||||
function exportGradient(color, item) {
|
||||
var gradientNode = getDefinition(color, 'color');
|
||||
if (!gradientNode) {
|
||||
var gradient = color.getGradient(),
|
||||
|
@ -14923,6 +14967,11 @@ new function() {
|
|||
y2: destination.y
|
||||
};
|
||||
}
|
||||
if (item instanceof paper.PointText) {
|
||||
attrs.gradientTransform = getTransform(
|
||||
item._matrix.clone().invert(), false, formatter).transform;
|
||||
}
|
||||
|
||||
attrs.gradientUnits = 'userSpaceOnUse';
|
||||
gradientNode = SvgElement.create((radial ? 'radial' : 'linear')
|
||||
+ 'Gradient', attrs, formatter);
|
||||
|
@ -14948,9 +14997,18 @@ new function() {
|
|||
}
|
||||
|
||||
function exportText(item) {
|
||||
var node = SvgElement.create('text', getTransform(item._matrix, true),
|
||||
var node = SvgElement.create('text', getTransform(item._matrix, false),
|
||||
formatter);
|
||||
node.textContent = item._content;
|
||||
node.setAttribute('font-size', item.fontSize);
|
||||
node.setAttribute('xml:space', 'preserve');
|
||||
for (var i = 0; i < item._lines.length; i++) {
|
||||
var tspanNode = SvgElement.create('tspan', {
|
||||
x: '0',
|
||||
dy: i === 0 ? '0' : item.getLeading() + 'px'
|
||||
}, formatter);
|
||||
tspanNode.textContent = item._lines[i] ? item._lines[i] : ' ';
|
||||
node.appendChild(tspanNode);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -14977,9 +15035,13 @@ new function() {
|
|||
var get = entry.get,
|
||||
type = entry.type,
|
||||
value = item[get]();
|
||||
|
||||
if (value === undefined) return;
|
||||
|
||||
if (entry.exportFilter
|
||||
? entry.exportFilter(item, value)
|
||||
: !parent || !Base.equals(parent[get](), value)) {
|
||||
: !parent || !Base.equals(parent[get](), value) ||
|
||||
item instanceof paper.PointText) {
|
||||
if (type === 'color' && value != null) {
|
||||
var alpha = value.getAlpha();
|
||||
if (alpha < 1)
|
||||
|
@ -15089,7 +15151,7 @@ new function() {
|
|||
rect = bounds === 'view'
|
||||
? new Rectangle([0, 0], view.getViewSize())
|
||||
: bounds === 'content'
|
||||
? Item._getBounds(children, matrix, { stroke: true })
|
||||
? Item._getBounds(children, matrix, { stroke: true, drawnTextBounds: true })
|
||||
.rect
|
||||
: Rectangle.read([bounds], 0, { readNull: true }),
|
||||
attrs = {
|
||||
|
@ -15333,10 +15395,44 @@ new function() {
|
|||
},
|
||||
|
||||
text: function(node) {
|
||||
var text = new PointText(getPoint(node).add(
|
||||
getPoint(node, 'dx', 'dy')));
|
||||
text.setContent(node.textContent.trim() || '');
|
||||
return text;
|
||||
|
||||
var fontSize = parseFloat(node.getAttribute("font-size"));
|
||||
var alignmentBaseline = node.getAttribute("alignment-baseline");
|
||||
if (node.childElementCount === 0) {
|
||||
var text = new PointText();
|
||||
text.setContent(node.textContent.trim() || '');
|
||||
text.translate(0, text._style.getLeading());
|
||||
if (!isNaN(fontSize)) text.setFontSize(fontSize);
|
||||
return text;
|
||||
} else {
|
||||
var lines = [];
|
||||
var spacing = 1.2;
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
var child = node.childNodes[i];
|
||||
if (!child.getAttribute) continue;
|
||||
lines.push(child.textContent);
|
||||
var dyString = child.getAttribute('dy');
|
||||
if (dyString) {
|
||||
var dy = parseFloat(dyString);
|
||||
if (!isNaN(dy)) {
|
||||
if (dyString.endsWith('em')) {
|
||||
spacing = dy;
|
||||
} else if (dyString.endsWith('px') && !isNaN(fontSize)) {
|
||||
spacing = dy / fontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var text = new PointText();
|
||||
if (!isNaN(fontSize)) text.setFontSize(fontSize);
|
||||
text.setLeading(text.fontSize * spacing);
|
||||
if (alignmentBaseline === 'text-before-edge') {
|
||||
text.setContent(' ');
|
||||
text.translate(0, text.bounds.height);
|
||||
}
|
||||
text.setContent(lines.join('\n'));
|
||||
return text;
|
||||
}
|
||||
},
|
||||
|
||||
switch: importGroup
|
||||
|
@ -15408,8 +15504,6 @@ new function() {
|
|||
}, {}), {
|
||||
id: function(item, value) {
|
||||
definitions[value] = item;
|
||||
if (item.setName)
|
||||
item.setName(value);
|
||||
},
|
||||
|
||||
'clip-path': function(item, value) {
|
||||
|
@ -15482,6 +15576,10 @@ new function() {
|
|||
if (matrix)
|
||||
group.transform(matrix);
|
||||
}
|
||||
},
|
||||
|
||||
'fill-rule': function(item, value) {
|
||||
if (value === 'evenodd' || value === 'nonzero') item.fillRule = value;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -15599,7 +15697,7 @@ new function() {
|
|||
var node = typeof svg === 'object'
|
||||
? svg
|
||||
: new self.DOMParser().parseFromString(
|
||||
svg.trim(),
|
||||
svg,
|
||||
'image/svg+xml'
|
||||
);
|
||||
if (!node.nodeName) {
|
||||
|
|
4
dist/docs/classes/Color.html
vendored
4
dist/docs/classes/Color.html
vendored
|
@ -2179,8 +2179,8 @@ circle.fillColor = Color.random();
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/CompoundPath.html
vendored
53
dist/docs/classes/CompoundPath.html
vendored
|
@ -3271,26 +3271,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3300,7 +3309,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3526,6 +3535,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3741,9 +3752,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3785,9 +3796,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3798,7 +3809,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3823,7 +3834,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -8868,8 +8879,8 @@ path.smooth();
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Curve.html
vendored
4
dist/docs/classes/Curve.html
vendored
|
@ -2314,8 +2314,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/CurveLocation.html
vendored
4
dist/docs/classes/CurveLocation.html
vendored
|
@ -663,8 +663,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Event.html
vendored
4
dist/docs/classes/Event.html
vendored
|
@ -167,8 +167,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Gradient.html
vendored
4
dist/docs/classes/Gradient.html
vendored
|
@ -231,8 +231,8 @@ path.fillColor = {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/GradientStop.html
vendored
4
dist/docs/classes/GradientStop.html
vendored
|
@ -264,8 +264,8 @@ function onFrame(event) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/Group.html
vendored
53
dist/docs/classes/Group.html
vendored
|
@ -3139,26 +3139,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3168,7 +3177,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3394,6 +3403,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3609,9 +3620,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3653,9 +3664,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3666,7 +3677,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3691,7 +3702,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -6855,8 +6866,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/HitResult.html
vendored
4
dist/docs/classes/HitResult.html
vendored
|
@ -230,8 +230,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/Item.html
vendored
53
dist/docs/classes/Item.html
vendored
|
@ -2900,26 +2900,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -2929,7 +2938,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3155,6 +3164,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3370,9 +3381,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3414,9 +3425,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3427,7 +3438,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3452,7 +3463,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -6619,8 +6630,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Key.html
vendored
4
dist/docs/classes/Key.html
vendored
|
@ -130,8 +130,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/KeyEvent.html
vendored
4
dist/docs/classes/KeyEvent.html
vendored
|
@ -299,8 +299,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/Layer.html
vendored
53
dist/docs/classes/Layer.html
vendored
|
@ -3055,26 +3055,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3084,7 +3093,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3310,6 +3319,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3525,9 +3536,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3569,9 +3580,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3582,7 +3593,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3607,7 +3618,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -6841,8 +6852,8 @@ function onFrame(event) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Matrix.html
vendored
4
dist/docs/classes/Matrix.html
vendored
|
@ -1735,8 +1735,8 @@ Array of <tt>Numbers</tt>
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/MouseEvent.html
vendored
4
dist/docs/classes/MouseEvent.html
vendored
|
@ -346,8 +346,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/PaperScope.html
vendored
4
dist/docs/classes/PaperScope.html
vendored
|
@ -450,8 +450,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/PaperScript.html
vendored
4
dist/docs/classes/PaperScript.html
vendored
|
@ -189,8 +189,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
55
dist/docs/classes/Path.html
vendored
55
dist/docs/classes/Path.html
vendored
|
@ -2337,7 +2337,7 @@ path.selected = true;
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Segment.html"><tt>Segment</tt></a></tt> — the newly inserted segment if the location is valid, <code>null</code> otherwise
|
||||
<tt><a href="../classes/Segment.html"><tt>Segment</tt></a></tt> — the newly inserted segment if the location is valid, {code null} otherwise
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -6210,26 +6210,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -6239,7 +6248,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -6465,6 +6474,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -6680,9 +6691,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -6724,9 +6735,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -6737,7 +6748,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -6762,7 +6773,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -11766,8 +11777,8 @@ path.smooth();
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/PathItem.html
vendored
53
dist/docs/classes/PathItem.html
vendored
|
@ -4914,26 +4914,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -4943,7 +4952,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -5169,6 +5178,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -5384,9 +5395,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -5428,9 +5439,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -5441,7 +5452,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -5466,7 +5477,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -8630,8 +8641,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Point.html
vendored
4
dist/docs/classes/Point.html
vendored
|
@ -2690,8 +2690,8 @@ var point = maxPoint * randomPoint;</code></pre>
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/PointText.html
vendored
53
dist/docs/classes/PointText.html
vendored
|
@ -3062,26 +3062,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3091,7 +3100,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3317,6 +3326,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3532,9 +3543,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3576,9 +3587,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3589,7 +3600,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3614,7 +3625,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -7020,8 +7031,8 @@ function onMouseMove(event) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Project.html
vendored
4
dist/docs/classes/Project.html
vendored
|
@ -1296,8 +1296,8 @@ for (var i = 0; i < items.length; i++) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
187
dist/docs/classes/Raster.html
vendored
187
dist/docs/classes/Raster.html
vendored
|
@ -105,6 +105,27 @@ var imageElement = document.getElementById('art');
|
|||
// Create the raster:
|
||||
var raster = new Raster(imageElement);</code></pre>
|
||||
|
||||
<h4>Example:</h4>
|
||||
|
||||
<div class="paperscript split">
|
||||
|
||||
<div class="buttons">
|
||||
<div class="button run">Run</div>
|
||||
</div>
|
||||
|
||||
<script type="text/paperscript" canvas="canvas-1">
|
||||
var raster = new Raster({
|
||||
source: 'http://assets.paperjs.org/images/marilyn.jpg',
|
||||
position: view.center
|
||||
});
|
||||
|
||||
raster.scale(0.5);
|
||||
raster.rotate(10);
|
||||
</script>
|
||||
<div class="canvas"><canvas width="516" height="300" id="canvas-1"></canvas></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -160,7 +181,7 @@ var raster = new Raster(imageElement);</code></pre>
|
|||
<div class="button run">Run</div>
|
||||
</div>
|
||||
|
||||
<script type="text/paperscript" canvas="canvas-1">
|
||||
<script type="text/paperscript" canvas="canvas-2">
|
||||
var width = 100;
|
||||
var height = 100;
|
||||
|
||||
|
@ -175,68 +196,7 @@ for (var i = 0; i < width; i++) {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
<div class="canvas"><canvas width="516" height="150" id="canvas-1"></canvas></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="raster-object" class="member">
|
||||
<div class="member-link">
|
||||
<a name="raster-object" href="#raster-object"><tt><b>Raster</b>(object)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Creates a new raster from an object description, and places it in the active layer.</p>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>object:</tt>
|
||||
<tt>Object</tt>
|
||||
— an object containing properties to be set on the raster
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4>Example:</h4>
|
||||
|
||||
<div class="paperscript split">
|
||||
|
||||
<div class="buttons">
|
||||
<div class="button run">Run</div>
|
||||
</div>
|
||||
|
||||
<script type="text/paperscript" canvas="canvas-2">
|
||||
var raster = new Raster({
|
||||
source: 'http://assets.paperjs.org/images/marilyn.jpg',
|
||||
position: view.center
|
||||
});
|
||||
|
||||
raster.scale(0.5);
|
||||
raster.rotate(10);
|
||||
</script>
|
||||
<div class="canvas"><canvas width="516" height="300" id="canvas-2"></canvas></div>
|
||||
<div class="canvas"><canvas width="516" height="150" id="canvas-2"></canvas></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -580,21 +540,19 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
|
|||
<div class="member-description hidden">
|
||||
|
||||
<div class="member-text">
|
||||
<p>Determines if the raster is drawn with pixel smoothing when scaled up or down, and if so, at which quality its pixels are to be smoothed. The settings of this property control both the <code>imageSmoothingEnabled</code> and <code>imageSmoothingQuality</code> properties of the <code>CanvasRenderingContext2D</code> interface.</p>
|
||||
<p>By default, smoothing is enabled at <code>'low'</code> quality. It can be set to of <code>'off'</code> to scale the raster’s pixels by repeating the nearest neighboring pixels, or to <code>'low'</code>, <code>'medium'</code> or <code>'high'</code> to control the various degrees of available image smoothing quality.</p>
|
||||
<p>For backward compatibility, it can can also be set to <code>false</code> (= <code>'off'</code>) or <code>true</code> (= <code>'low'</code>).</p>
|
||||
<p>Specifies if the raster should be smoothed when scaled up or if the pixels should be scaled up by repeating the nearest neighboring pixels.</p>
|
||||
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Default:</h4>
|
||||
<li><tt>'low'</tt></li>
|
||||
<li><tt>false</tt></li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Type:</h4>
|
||||
<li>
|
||||
<tt>String</tt>
|
||||
<tt>Boolean</tt>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -608,8 +566,9 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
|
|||
</div>
|
||||
|
||||
<script type="text/paperscript" canvas="canvas-6">
|
||||
var raster = new Raster({source:
|
||||
'http://assets.paperjs.org/images/marilyn.jpg', smoothing: 'off'
|
||||
var raster = new Raster({
|
||||
source: 'http://assets.paperjs.org/images/marilyn.jpg',
|
||||
smoothing: false
|
||||
});
|
||||
raster.scale(5);
|
||||
</script>
|
||||
|
@ -1171,9 +1130,9 @@ raster.on('load', function() {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="putimagedata-data-point" class="member">
|
||||
<div id="setimagedata-data-point" class="member">
|
||||
<div class="member-link">
|
||||
<a name="putimagedata-data-point" href="#putimagedata-data-point"><tt><b>putImageData</b>(data, point)</tt></a>
|
||||
<a name="setimagedata-data-point" href="#setimagedata-data-point"><tt><b>setImageData</b>(data, point)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -1204,37 +1163,6 @@ raster.on('load', function() {
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="setimagedata-data" class="member">
|
||||
<div class="member-link">
|
||||
<a name="setimagedata-data" href="#setimagedata-data"><tt><b>setImageData</b>(data)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>data:</tt>
|
||||
<tt>ImageData</tt>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4118,26 +4046,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -4147,7 +4084,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -4373,6 +4310,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -4588,9 +4527,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -4632,9 +4571,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -4645,7 +4584,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -4670,7 +4609,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -7834,8 +7773,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Rectangle.html
vendored
4
dist/docs/classes/Rectangle.html
vendored
|
@ -1645,8 +1645,8 @@ intersectionPath.fillColor = 'red';
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Segment.html
vendored
4
dist/docs/classes/Segment.html
vendored
|
@ -930,8 +930,8 @@ path.segments[2].selected = true;
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/Shape.html
vendored
53
dist/docs/classes/Shape.html
vendored
|
@ -3638,26 +3638,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3667,7 +3676,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3893,6 +3902,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -4108,9 +4119,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -4152,9 +4163,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -4165,7 +4176,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -4190,7 +4201,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -7354,8 +7365,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Size.html
vendored
4
dist/docs/classes/Size.html
vendored
|
@ -1816,8 +1816,8 @@ var size = maxSize * randomSize;</code></pre>
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Style.html
vendored
4
dist/docs/classes/Style.html
vendored
|
@ -910,8 +910,8 @@ var circle = new Path.Circle({
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/SymbolDefinition.html
vendored
4
dist/docs/classes/SymbolDefinition.html
vendored
|
@ -302,8 +302,8 @@ for (var i = 0; i < 100; i++) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/SymbolItem.html
vendored
53
dist/docs/classes/SymbolItem.html
vendored
|
@ -3030,26 +3030,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3059,7 +3068,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3285,6 +3294,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3500,9 +3511,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3544,9 +3555,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3557,7 +3568,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3582,7 +3593,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -6746,8 +6757,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
53
dist/docs/classes/TextItem.html
vendored
53
dist/docs/classes/TextItem.html
vendored
|
@ -3144,26 +3144,35 @@ for (var i = 0; i < 20; i++) {
|
|||
|
||||
<div id="rasterize" class="member">
|
||||
<div class="member-link">
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([options])</tt></a>
|
||||
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution[, insert[, boundRect]]])</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
||||
<ul class="member-list">
|
||||
<h4>Options:</h4>
|
||||
<li><tt>resolution: <tt>Number</tt></tt> — the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. — default: <tt>view.resolution</tt></li>
|
||||
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. — default: <tt>null</tt></li>
|
||||
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>Object</tt>
|
||||
— the rasterization options
|
||||
— optional, default: <tt>{}</tt>
|
||||
<tt>resolution:</tt>
|
||||
<tt>Number</tt>
|
||||
— the resolution of the raster in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used.
|
||||
— optional, default: <tt>view.resolution</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>insert:</tt>
|
||||
<tt>Boolean</tt>
|
||||
— specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the original
|
||||
— optional, default: <tt>true</tt>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<tt>boundRect:</tt>
|
||||
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
||||
— bounds within which to rasterize. Defaults to stroke bounds.
|
||||
— optional
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -3173,7 +3182,7 @@ for (var i = 0; i < 20; i++) {
|
|||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the reused raster or the newly created raster item
|
||||
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — the newly created raster item
|
||||
</li>
|
||||
|
||||
|
||||
|
@ -3399,6 +3408,8 @@ function onMouseDown(event) {
|
|||
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
||||
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
|
||||
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
||||
<li><tt>options.hitUnfilledPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 fills for paths</li>
|
||||
<li><tt>options.hitUnstrokedPaths: <tt>Boolean</tt></tt> — Allow hitting null or alpha 0 strokes for paths</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3614,9 +3625,9 @@ function onMouseDown(event) {
|
|||
<h4>Options:</h4>
|
||||
<li><tt>options.recursive: <tt>Boolean</tt></tt> — whether to loop recursively through all children, or stop at the current level — default: <tt>true</tt></li>
|
||||
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each item, allowing the definition of more flexible item checks that are not bound to properties. If no other match properties are defined, this function can also be passed instead of the <code>options</code> object</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
<li><tt>options.class: <tt>Function</tt></tt> — the constructor function of the item type to match against</li>
|
||||
<li><tt>options.inside: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle in which the items need to be fully contained</li>
|
||||
<li><tt>options.overlapping: <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> — the rectangle with which the items need to at least partly overlap</li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
|
@ -3658,9 +3669,9 @@ function onMouseDown(event) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="getitem-options" class="member">
|
||||
<div id="getitem-match" class="member">
|
||||
<div class="member-link">
|
||||
<a name="getitem-options" href="#getitem-options"><tt><b>getItem</b>(options)</tt></a>
|
||||
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
|
@ -3671,7 +3682,7 @@ function onMouseDown(event) {
|
|||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>options:</tt>
|
||||
<tt>match:</tt>
|
||||
<tt>Object</tt>⟋<tt>Function</tt>
|
||||
— the criteria to match against
|
||||
|
||||
|
@ -3696,7 +3707,7 @@ function onMouseDown(event) {
|
|||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><a href="../classes/Item.html#getitems-options"><tt>getItems(options)</tt></a></tt></li>
|
||||
<li><tt><a href="../classes/Item.html#getitems-match"><tt>getItems(match)</tt></a></tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -6860,8 +6871,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Tool.html
vendored
4
dist/docs/classes/Tool.html
vendored
|
@ -752,8 +752,8 @@ tool.onKeyDown = function(event) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/ToolEvent.html
vendored
4
dist/docs/classes/ToolEvent.html
vendored
|
@ -437,8 +437,8 @@ function onMouseUp(event) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/Tween.html
vendored
4
dist/docs/classes/Tween.html
vendored
|
@ -365,8 +365,8 @@ setTimeout(function(){
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/View.html
vendored
4
dist/docs/classes/View.html
vendored
|
@ -1763,8 +1763,8 @@ function onMouseDown(event) {
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/global.html
vendored
4
dist/docs/classes/global.html
vendored
|
@ -416,8 +416,8 @@
|
|||
|
||||
<!-- =========================== copyright notice ========================== -->
|
||||
<p class="footer">
|
||||
Paper.js v0.12.15 (develop)<br>
|
||||
Copyright © 2011—2021 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
Paper.js v0.12.7<br>
|
||||
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
||||
<div class="content-end"></div>
|
||||
|
||||
|
||||
|
|
4
dist/docs/classes/index.html
vendored
4
dist/docs/classes/index.html
vendored
|
@ -2,13 +2,13 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Paper.js v0.12.15 (develop)</title>
|
||||
<title>Paper.js v0.12.7</title>
|
||||
<base target="class-frame">
|
||||
<link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body class="reference">
|
||||
<div class="reference-index">
|
||||
<h1>Paper.js<span class="version">0.12.15 (develop)</span></h1>
|
||||
<h1>Paper.js<span class="version">0.12.7</span></h1>
|
||||
<ul class="reference-classes"><li><a href="../classes/global.html">Global Scope</a></li>
|
||||
<li>
|
||||
<h2>Basic Types</h2>
|
||||
|
|
2
dist/docs/index.html
vendored
2
dist/docs/index.html
vendored
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Paper.js v0.12.15 (develop)</title>
|
||||
<title>Paper.js v0.12.7</title>
|
||||
</head>
|
||||
<frameset cols="230,*">
|
||||
<frame src="classes/index.html" name="packageListFrame" title="All Packages">
|
||||
|
|
1
dist/paper-core.d.ts
vendored
1
dist/paper-core.d.ts
vendored
|
@ -1 +0,0 @@
|
|||
import './paper';
|
358
dist/paper-core.js
vendored
358
dist/paper-core.js
vendored
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Paper.js v0.12.15-develop - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* Paper.js v0.12.7 - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
||||
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Mon Mar 22 17:03:39 2021 +0100
|
||||
* Date: Thu Dec 1 12:02:03 2022 -0800
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -33,7 +33,7 @@
|
|||
var paper = function(self, undefined) {
|
||||
|
||||
self = self || require('./node/self.js');
|
||||
var window = self.window,
|
||||
var window = self.window ? self.window : self,
|
||||
document = self.document;
|
||||
|
||||
var Base = new function() {
|
||||
|
@ -821,7 +821,7 @@ var PaperScope = Base.extend({
|
|||
}
|
||||
},
|
||||
|
||||
version: "0.12.15-develop",
|
||||
version: "0.12.7",
|
||||
|
||||
getView: function() {
|
||||
var project = this.project;
|
||||
|
@ -3452,7 +3452,8 @@ new function() {
|
|||
}, Base.each({
|
||||
getStrokeBounds: { stroke: true },
|
||||
getHandleBounds: { handle: true },
|
||||
getInternalBounds: { internal: true }
|
||||
getInternalBounds: { internal: true },
|
||||
getDrawnBounds: { stroke: true, drawnTextBounds: true },
|
||||
},
|
||||
function(options, key) {
|
||||
this[key] = function(matrix) {
|
||||
|
@ -3509,6 +3510,7 @@ new function() {
|
|||
return [
|
||||
options.stroke ? 1 : 0,
|
||||
options.handle ? 1 : 0,
|
||||
options.drawnTextBounds? 1 : 0,
|
||||
internal ? 1 : 0
|
||||
].join('');
|
||||
},
|
||||
|
@ -3657,25 +3659,15 @@ new function() {
|
|||
var rotation = this.getRotation(),
|
||||
decomposed = this._decomposed,
|
||||
matrix = new Matrix(),
|
||||
isZero = Numerical.isZero;
|
||||
if (isZero(current.x) || isZero(current.y)) {
|
||||
matrix.translate(decomposed.translation);
|
||||
if (rotation) {
|
||||
matrix.rotate(rotation);
|
||||
}
|
||||
matrix.scale(scaling.x, scaling.y);
|
||||
this._matrix.set(matrix);
|
||||
} else {
|
||||
var center = this.getPosition(true);
|
||||
matrix.translate(center);
|
||||
if (rotation)
|
||||
matrix.rotate(rotation);
|
||||
matrix.scale(scaling.x / current.x, scaling.y / current.y);
|
||||
if (rotation)
|
||||
matrix.rotate(-rotation);
|
||||
matrix.translate(center.negate());
|
||||
this.transform(matrix);
|
||||
}
|
||||
center = this.getPosition(true);
|
||||
matrix.translate(center);
|
||||
if (rotation)
|
||||
matrix.rotate(rotation);
|
||||
matrix.scale(scaling.x / current.x, scaling.y / current.y);
|
||||
if (rotation)
|
||||
matrix.rotate(-rotation);
|
||||
matrix.translate(center.negate());
|
||||
this.transform(matrix);
|
||||
if (decomposed) {
|
||||
decomposed.scaling = scaling;
|
||||
this._decomposed = decomposed;
|
||||
|
@ -3689,7 +3681,7 @@ new function() {
|
|||
|
||||
setMatrix: function() {
|
||||
var matrix = this._matrix;
|
||||
matrix.set.apply(matrix, arguments);
|
||||
matrix.initialize.apply(matrix, arguments);
|
||||
},
|
||||
|
||||
getGlobalMatrix: function(_dontClone) {
|
||||
|
@ -3888,45 +3880,28 @@ new function() {
|
|||
this.setName(name);
|
||||
},
|
||||
|
||||
rasterize: function(arg0, arg1) {
|
||||
var resolution,
|
||||
insert,
|
||||
raster;
|
||||
if (Base.isPlainObject(arg0)) {
|
||||
resolution = arg0.resolution;
|
||||
insert = arg0.insert;
|
||||
raster = arg0.raster;
|
||||
} else {
|
||||
resolution = arg0;
|
||||
insert = arg1;
|
||||
}
|
||||
if (!raster) {
|
||||
raster = new Raster(Item.NO_INSERT);
|
||||
}
|
||||
var bounds = this.getStrokeBounds(),
|
||||
rasterize: function(resolution, insert, boundRect) {
|
||||
var bounds = boundRect ? boundRect : this.getStrokeBounds(),
|
||||
scale = (resolution || this.getView().getResolution()) / 72,
|
||||
topLeft = bounds.getTopLeft().floor(),
|
||||
bottomRight = bounds.getBottomRight().ceil(),
|
||||
boundsSize = new Size(bottomRight.subtract(topLeft)),
|
||||
rasterSize = boundsSize.multiply(scale);
|
||||
raster.setSize(rasterSize, true);
|
||||
|
||||
if (!rasterSize.isZero()) {
|
||||
var ctx = raster.getContext(true),
|
||||
size = new Size(bottomRight.subtract(topLeft)),
|
||||
raster = new Raster(Item.NO_INSERT);
|
||||
if (!size.isZero()) {
|
||||
var canvas = CanvasProvider.getCanvas(size.multiply(scale)),
|
||||
ctx = canvas.getContext('2d'),
|
||||
matrix = new Matrix().scale(scale).translate(topLeft.negate());
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
ctx.save();
|
||||
matrix.applyToContext(ctx);
|
||||
this.draw(ctx, new Base({ matrices: [matrix] }));
|
||||
ctx.restore();
|
||||
raster.setCanvas(canvas);
|
||||
}
|
||||
raster._matrix.set(
|
||||
new Matrix()
|
||||
.translate(topLeft.add(boundsSize.divide(2)))
|
||||
.scale(1 / scale)
|
||||
);
|
||||
if (insert === undefined || insert) {
|
||||
raster.transform(new Matrix().translate(topLeft.add(size.divide(2)))
|
||||
.scale(1 / scale));
|
||||
if (insert === undefined || insert)
|
||||
raster.insertAbove(this);
|
||||
}
|
||||
return raster;
|
||||
},
|
||||
|
||||
|
@ -4646,14 +4621,14 @@ new function() {
|
|||
}
|
||||
}), {
|
||||
|
||||
_setStyles: function(ctx, param, viewMatrix) {
|
||||
_setStyles: function(ctx, param, viewMatrix, strokeMatrix) {
|
||||
var style = this._style,
|
||||
matrix = this._matrix;
|
||||
if (style.hasFill()) {
|
||||
ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix);
|
||||
ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix, strokeMatrix);
|
||||
}
|
||||
if (style.hasStroke()) {
|
||||
ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix);
|
||||
ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix, strokeMatrix);
|
||||
ctx.lineWidth = style.getStrokeWidth();
|
||||
var strokeJoin = style.getStrokeJoin(),
|
||||
strokeCap = style.getStrokeCap(),
|
||||
|
@ -4805,6 +4780,7 @@ new function() {
|
|||
half = size / 2;
|
||||
ctx.strokeStyle = ctx.fillStyle = color
|
||||
? color.toCanvasStyle(ctx) : '#009dec';
|
||||
ctx.lineWidth=2.5;
|
||||
if (itemSelected)
|
||||
this._drawSelected(ctx, mx, selectionItems);
|
||||
if (positionSelected) {
|
||||
|
@ -5197,7 +5173,7 @@ var Shape = Item.extend({
|
|||
ctx.closePath();
|
||||
}
|
||||
if (!dontPaint && (hasFill || hasStroke)) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
if (hasFill) {
|
||||
ctx.fill(style.getFillRule());
|
||||
ctx.shadowColor = 'rgba(0,0,0,0)';
|
||||
|
@ -5360,7 +5336,7 @@ var Raster = Item.extend({
|
|||
source: null
|
||||
},
|
||||
_prioritize: ['crossOrigin'],
|
||||
_smoothing: 'low',
|
||||
_smoothing: false,
|
||||
beans: true,
|
||||
|
||||
initialize: function Raster(source, position) {
|
||||
|
@ -5418,23 +5394,20 @@ var Raster = Item.extend({
|
|||
this, 'setSize');
|
||||
},
|
||||
|
||||
setSize: function(_size, _clear) {
|
||||
setSize: function() {
|
||||
var size = Size.read(arguments);
|
||||
if (!size.equals(this._size)) {
|
||||
if (size.width > 0 && size.height > 0) {
|
||||
var element = !_clear && this.getElement();
|
||||
var element = this.getElement();
|
||||
this._setImage(CanvasProvider.getCanvas(size));
|
||||
if (element) {
|
||||
if (element)
|
||||
this.getContext(true).drawImage(element, 0, 0,
|
||||
size.width, size.height);
|
||||
}
|
||||
} else {
|
||||
if (this._canvas)
|
||||
CanvasProvider.release(this._canvas);
|
||||
this._size = size.clone();
|
||||
}
|
||||
} else if (_clear) {
|
||||
this.clear();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -5587,9 +5560,7 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSmoothing: function(smoothing) {
|
||||
this._smoothing = typeof smoothing === 'string'
|
||||
? smoothing
|
||||
: smoothing ? 'low' : 'off';
|
||||
this._smoothing = smoothing;
|
||||
this._changed(257);
|
||||
},
|
||||
|
||||
|
@ -5602,8 +5573,16 @@ var Raster = Item.extend({
|
|||
getSubCanvas: function() {
|
||||
var rect = Rectangle.read(arguments),
|
||||
ctx = CanvasProvider.getContext(rect.getSize());
|
||||
ctx.drawImage(this.getCanvas(), rect.x, rect.y,
|
||||
rect.width, rect.height, 0, 0, rect.width, rect.height);
|
||||
var clippedStartX = Math.max(0, rect.x);
|
||||
var clippedStartY = Math.max(0, rect.y);
|
||||
var clippedEndX = Math.min(this.getCanvas().width, rect.x + rect.width);
|
||||
var clippedEndY = Math.min(this.getCanvas().height, rect.y + rect.height);
|
||||
ctx.drawImage(this.getCanvas(),
|
||||
clippedStartX, clippedStartY,
|
||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY,
|
||||
clippedStartX - rect.x, clippedStartY - rect.y,
|
||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY
|
||||
);
|
||||
return ctx.canvas;
|
||||
},
|
||||
|
||||
|
@ -5728,16 +5707,11 @@ var Raster = Item.extend({
|
|||
rect.width, rect.height);
|
||||
},
|
||||
|
||||
putImageData: function(data ) {
|
||||
setImageData: function(data ) {
|
||||
var point = Point.read(arguments, 1);
|
||||
this.getContext(true).putImageData(data, point.x, point.y);
|
||||
},
|
||||
|
||||
setImageData: function(data) {
|
||||
this.setSize(data);
|
||||
this.getContext(true).putImageData(data, 0, 0);
|
||||
},
|
||||
|
||||
_getBounds: function(matrix, options) {
|
||||
var rect = new Rectangle(this._size).setCenter(0, 0);
|
||||
return matrix ? matrix._transformBounds(rect) : rect;
|
||||
|
@ -5764,12 +5738,8 @@ var Raster = Item.extend({
|
|||
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
|
||||
var smoothing = this._smoothing,
|
||||
disabled = smoothing === 'off';
|
||||
DomElement.setPrefixed(
|
||||
ctx,
|
||||
disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality',
|
||||
disabled ? false : smoothing
|
||||
ctx, 'imageSmoothingEnabled', this._smoothing
|
||||
);
|
||||
|
||||
ctx.drawImage(element,
|
||||
|
@ -6839,13 +6809,13 @@ statics: {
|
|||
}
|
||||
|
||||
padding /= 2;
|
||||
var minPad = min[coord] + padding,
|
||||
maxPad = max[coord] - padding;
|
||||
var minPad = min[coord] - padding,
|
||||
maxPad = max[coord] + padding;
|
||||
if ( v0 < minPad || v1 < minPad || v2 < minPad || v3 < minPad ||
|
||||
v0 > maxPad || v1 > maxPad || v2 > maxPad || v3 > maxPad) {
|
||||
if (v1 < v0 != v1 < v3 && v2 < v0 != v2 < v3) {
|
||||
add(v0, 0);
|
||||
add(v3, 0);
|
||||
add(v0, padding);
|
||||
add(v3, padding);
|
||||
} else {
|
||||
var a = 3 * (v1 - v2) - v0 + v3,
|
||||
b = 2 * (v0 + v2) - 4 * v1,
|
||||
|
@ -9169,8 +9139,8 @@ var Path = PathItem.extend({
|
|||
strokePadding = tolerancePadding,
|
||||
join, cap, miterLimit,
|
||||
area, loc, res,
|
||||
hitStroke = options.stroke && style.hasStroke(),
|
||||
hitFill = options.fill && style.hasFill(),
|
||||
hitStroke = options.stroke && (style.hasStroke() || options.hitUnstrokedPaths),
|
||||
hitFill = options.fill && (style.hasFill() || options.hitUnfilledPaths),
|
||||
hitCurves = options.curves,
|
||||
strokeRadius = hitStroke
|
||||
? style.getStrokeWidth() / 2
|
||||
|
@ -9358,12 +9328,10 @@ var Path = PathItem.extend({
|
|||
}),
|
||||
new function() {
|
||||
|
||||
function drawHandles(ctx, segments, matrix, size) {
|
||||
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||
if (size <= 0) return;
|
||||
|
||||
var half = size / 2,
|
||||
miniSize = size - 2,
|
||||
miniHalf = half - 1,
|
||||
coords = new Array(6),
|
||||
pX, pY;
|
||||
|
||||
|
@ -9374,10 +9342,12 @@ new function() {
|
|||
ctx.beginPath();
|
||||
ctx.moveTo(pX, pY);
|
||||
ctx.lineTo(hX, hY);
|
||||
ctx.moveTo(hX - half, hY);
|
||||
ctx.lineTo(hX, hY + half);
|
||||
ctx.lineTo(hX + half, hY);
|
||||
ctx.lineTo(hX, hY - half);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9387,17 +9357,19 @@ new function() {
|
|||
segment._transformCoordinates(matrix, coords);
|
||||
pX = coords[0];
|
||||
pY = coords[1];
|
||||
if (selection & 2)
|
||||
if (selection & 2 && !isFullySelected)
|
||||
drawHandle(2);
|
||||
if (selection & 4)
|
||||
if (selection & 4 && !isFullySelected)
|
||||
drawHandle(4);
|
||||
ctx.fillRect(pX - half, pY - half, size, size);
|
||||
if (miniSize > 0 && !(selection & 1)) {
|
||||
var fillStyle = ctx.fillStyle;
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillRect(pX - miniHalf, pY - miniHalf, miniSize, miniSize);
|
||||
ctx.fillStyle = fillStyle;
|
||||
ctx.beginPath();
|
||||
ctx.arc(pX, pY, half, 0, Math.PI * 2, true);
|
||||
ctx.stroke();
|
||||
var fillStyle = ctx.fillStyle;
|
||||
if (!(selection & 1)) {
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||
}
|
||||
ctx.fill();
|
||||
ctx.fillStyle = fillStyle;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9483,7 +9455,7 @@ new function() {
|
|||
}
|
||||
|
||||
if (!dontPaint && (hasFill || hasStroke)) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
if (hasFill) {
|
||||
ctx.fill(style.getFillRule());
|
||||
ctx.shadowColor = 'rgba(0,0,0,0)';
|
||||
|
@ -9497,6 +9469,7 @@ new function() {
|
|||
length = flattener.length,
|
||||
from = -style.getDashOffset(), to,
|
||||
i = 0;
|
||||
from = from % length;
|
||||
while (from > 0) {
|
||||
from -= getOffset(i--) + getOffset(i--);
|
||||
}
|
||||
|
@ -9517,7 +9490,8 @@ new function() {
|
|||
ctx.beginPath();
|
||||
drawSegments(ctx, this, matrix);
|
||||
ctx.stroke();
|
||||
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize);
|
||||
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize,
|
||||
this.isFullySelected());
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -10237,7 +10211,7 @@ var CompoundPath = PathItem.extend({
|
|||
|
||||
_hitTestChildren: function _hitTestChildren(point, options, viewMatrix) {
|
||||
return _hitTestChildren.base.call(this, point,
|
||||
options.class === Path || options.type === 'path' ? options
|
||||
options.class === Path || options.type === 'path' || options.hitUnfilledPaths ? options
|
||||
: Base.set({}, options, { fill: false }),
|
||||
viewMatrix);
|
||||
},
|
||||
|
@ -10253,7 +10227,7 @@ var CompoundPath = PathItem.extend({
|
|||
children[i].draw(ctx, param, strokeMatrix);
|
||||
|
||||
if (!param.clip) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
var style = this._style;
|
||||
if (style.hasFill()) {
|
||||
ctx.fill(style.getFillRule());
|
||||
|
@ -11625,6 +11599,11 @@ var PointText = TextItem.extend({
|
|||
},
|
||||
|
||||
_getBounds: function(matrix, options) {
|
||||
var rect = options.drawnTextBounds ? this._getDrawnTextSize() : this._getMeasuredTextSize();
|
||||
return matrix ? matrix._transformBounds(rect, rect) : rect;
|
||||
},
|
||||
|
||||
_getMeasuredTextSize: function() {
|
||||
var style = this._style,
|
||||
lines = this._lines,
|
||||
numLines = lines.length,
|
||||
|
@ -11634,10 +11613,67 @@ var PointText = TextItem.extend({
|
|||
x = 0;
|
||||
if (justification !== 'left')
|
||||
x -= width / (justification === 'center' ? 2: 1);
|
||||
var rect = new Rectangle(x,
|
||||
return new Rectangle(x,
|
||||
numLines ? - 0.75 * leading : 0,
|
||||
width, numLines * leading);
|
||||
return matrix ? matrix._transformBounds(rect, rect) : rect;
|
||||
},
|
||||
|
||||
_getDrawnTextSize: function() {
|
||||
var style = this._style;
|
||||
var lines = this._lines;
|
||||
var numLines = lines.length;
|
||||
var leading = style.getLeading();
|
||||
var justification = style.getJustification();
|
||||
|
||||
var svg = SvgElement.create('svg', {
|
||||
version: '1.1',
|
||||
xmlns: SvgElement.svg
|
||||
});
|
||||
var node = SvgElement.create('text');
|
||||
node.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
||||
svg.appendChild(node);
|
||||
for (var i = 0; i < numLines; i++) {
|
||||
var tspanNode = SvgElement.create('tspan', {
|
||||
x: '0',
|
||||
dy: i === 0 ? '0' : leading + 'px'
|
||||
});
|
||||
tspanNode.textContent = this._lines[i];
|
||||
node.appendChild(tspanNode);
|
||||
}
|
||||
|
||||
var element = document.createElement('span');
|
||||
element.style.visibility = ('hidden');
|
||||
element.style.whiteSpace = 'pre';
|
||||
element.style.fontSize = this.fontSize + 'px';
|
||||
element.style.fontFamily = this.font;
|
||||
element.style.lineHeight = this.leading / this.fontSize;
|
||||
|
||||
var bbox;
|
||||
try {
|
||||
element.appendChild(svg);
|
||||
document.body.appendChild(element);
|
||||
bbox = svg.getBBox();
|
||||
} finally {
|
||||
document.body.removeChild(element);
|
||||
}
|
||||
|
||||
var halfStrokeWidth = this.strokeWidth / 2;
|
||||
var width = bbox.width + (halfStrokeWidth * 2);
|
||||
var height = bbox.height + (halfStrokeWidth * 2);
|
||||
var x = bbox.x - halfStrokeWidth;
|
||||
var y = bbox.y - halfStrokeWidth;
|
||||
|
||||
if (justification !== 'left') {
|
||||
var eltWidth = this.getView().getTextWidth(style.getFontStyle(), lines);
|
||||
x -= eltWidth / (justification === 'center' ? 2: 1);
|
||||
}
|
||||
|
||||
return new Rectangle(x, y, width + 1, Math.max(height, numLines * leading));
|
||||
},
|
||||
|
||||
_hitTestSelf: function(point, options) {
|
||||
if (options.fill && (this.hasFill() || options.hitUnfilledPaths) && this._contains(point))
|
||||
return new HitResult('fill', this);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -12109,8 +12145,9 @@ var Color = Base.extend(new function() {
|
|||
+ components.join(',') + ')';
|
||||
},
|
||||
|
||||
toCanvasStyle: function(ctx, matrix) {
|
||||
if (this._canvasStyle)
|
||||
toCanvasStyle: function(ctx, matrix, strokeMatrix) {
|
||||
var strokeMayChange = this._type === 'gradient' && strokeMatrix;
|
||||
if (this._canvasStyle && !strokeMayChange)
|
||||
return this._canvasStyle;
|
||||
if (this._type !== 'gradient')
|
||||
return this._canvasStyle = this.toCSS();
|
||||
|
@ -12128,6 +12165,12 @@ var Color = Base.extend(new function() {
|
|||
if (highlight)
|
||||
highlight = inverse._transformPoint(highlight);
|
||||
}
|
||||
if (strokeMatrix) {
|
||||
origin = strokeMatrix._transformPoint(origin);
|
||||
destination = strokeMatrix._transformPoint(destination);
|
||||
if (highlight)
|
||||
highlight = strokeMatrix._transformPoint(highlight);
|
||||
}
|
||||
if (gradient._radial) {
|
||||
var radius = destination.getDistance(origin);
|
||||
if (highlight) {
|
||||
|
@ -12149,7 +12192,8 @@ var Color = Base.extend(new function() {
|
|||
offset == null ? i / (l - 1) : offset,
|
||||
stop._color.toCanvasStyle());
|
||||
}
|
||||
return this._canvasStyle = canvasGradient;
|
||||
if (!strokeMayChange) this._canvasStyle = canvasGradient;
|
||||
return canvasGradient;
|
||||
},
|
||||
|
||||
transform: function(matrix) {
|
||||
|
@ -13165,7 +13209,7 @@ var View = Base.extend(Emitter, {
|
|||
|
||||
setMatrix: function() {
|
||||
var matrix = this._matrix;
|
||||
matrix.set.apply(matrix, arguments);
|
||||
matrix.initialize.apply(matrix, arguments);
|
||||
},
|
||||
|
||||
transform: function(matrix) {
|
||||
|
@ -14059,7 +14103,7 @@ var Tween = Base.extend(Emitter, {
|
|||
_class: 'Tween',
|
||||
|
||||
statics: {
|
||||
easings: new Base({
|
||||
easings: {
|
||||
linear: function(t) {
|
||||
return t;
|
||||
},
|
||||
|
@ -14119,7 +14163,7 @@ var Tween = Base.extend(Emitter, {
|
|||
? 16 * t * t * t * t * t
|
||||
: 1 + 16 * (--t) * t * t * t * t;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function Tween(object, from, to, duration, easing, start) {
|
||||
|
@ -14165,7 +14209,7 @@ var Tween = Base.extend(Emitter, {
|
|||
|
||||
update: function(progress) {
|
||||
if (this.running) {
|
||||
if (progress >= 1) {
|
||||
if (progress > 1) {
|
||||
progress = 1;
|
||||
this.running = false;
|
||||
}
|
||||
|
@ -14187,15 +14231,15 @@ var Tween = Base.extend(Emitter, {
|
|||
this._setProperty(this._parsedKeys[key], value);
|
||||
}
|
||||
|
||||
if (!this.running && this._then) {
|
||||
this._then(this.object);
|
||||
}
|
||||
if (this.responds('update')) {
|
||||
this.emit('update', new Base({
|
||||
progress: progress,
|
||||
factor: factor
|
||||
}));
|
||||
}
|
||||
if (!this.running && this._then) {
|
||||
this._then(this.object);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
@ -14325,7 +14369,7 @@ var Http = {
|
|||
}
|
||||
};
|
||||
|
||||
var CanvasProvider = Base.exports.CanvasProvider = {
|
||||
var CanvasProvider = {
|
||||
canvases: [],
|
||||
|
||||
getCanvas: function(width, height) {
|
||||
|
@ -14893,7 +14937,7 @@ new function() {
|
|||
return SvgElement.create('use', attrs, formatter);
|
||||
}
|
||||
|
||||
function exportGradient(color) {
|
||||
function exportGradient(color, item) {
|
||||
var gradientNode = getDefinition(color, 'color');
|
||||
if (!gradientNode) {
|
||||
var gradient = color.getGradient(),
|
||||
|
@ -14920,6 +14964,11 @@ new function() {
|
|||
y2: destination.y
|
||||
};
|
||||
}
|
||||
if (item instanceof paper.PointText) {
|
||||
attrs.gradientTransform = getTransform(
|
||||
item._matrix.clone().invert(), false, formatter).transform;
|
||||
}
|
||||
|
||||
attrs.gradientUnits = 'userSpaceOnUse';
|
||||
gradientNode = SvgElement.create((radial ? 'radial' : 'linear')
|
||||
+ 'Gradient', attrs, formatter);
|
||||
|
@ -14945,9 +14994,18 @@ new function() {
|
|||
}
|
||||
|
||||
function exportText(item) {
|
||||
var node = SvgElement.create('text', getTransform(item._matrix, true),
|
||||
var node = SvgElement.create('text', getTransform(item._matrix, false),
|
||||
formatter);
|
||||
node.textContent = item._content;
|
||||
node.setAttribute('font-size', item.fontSize);
|
||||
node.setAttribute('xml:space', 'preserve');
|
||||
for (var i = 0; i < item._lines.length; i++) {
|
||||
var tspanNode = SvgElement.create('tspan', {
|
||||
x: '0',
|
||||
dy: i === 0 ? '0' : item.getLeading() + 'px'
|
||||
}, formatter);
|
||||
tspanNode.textContent = item._lines[i] ? item._lines[i] : ' ';
|
||||
node.appendChild(tspanNode);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -14974,9 +15032,13 @@ new function() {
|
|||
var get = entry.get,
|
||||
type = entry.type,
|
||||
value = item[get]();
|
||||
|
||||
if (value === undefined) return;
|
||||
|
||||
if (entry.exportFilter
|
||||
? entry.exportFilter(item, value)
|
||||
: !parent || !Base.equals(parent[get](), value)) {
|
||||
: !parent || !Base.equals(parent[get](), value) ||
|
||||
item instanceof paper.PointText) {
|
||||
if (type === 'color' && value != null) {
|
||||
var alpha = value.getAlpha();
|
||||
if (alpha < 1)
|
||||
|
@ -15086,7 +15148,7 @@ new function() {
|
|||
rect = bounds === 'view'
|
||||
? new Rectangle([0, 0], view.getViewSize())
|
||||
: bounds === 'content'
|
||||
? Item._getBounds(children, matrix, { stroke: true })
|
||||
? Item._getBounds(children, matrix, { stroke: true, drawnTextBounds: true })
|
||||
.rect
|
||||
: Rectangle.read([bounds], 0, { readNull: true }),
|
||||
attrs = {
|
||||
|
@ -15330,10 +15392,44 @@ new function() {
|
|||
},
|
||||
|
||||
text: function(node) {
|
||||
var text = new PointText(getPoint(node).add(
|
||||
getPoint(node, 'dx', 'dy')));
|
||||
text.setContent(node.textContent.trim() || '');
|
||||
return text;
|
||||
|
||||
var fontSize = parseFloat(node.getAttribute("font-size"));
|
||||
var alignmentBaseline = node.getAttribute("alignment-baseline");
|
||||
if (node.childElementCount === 0) {
|
||||
var text = new PointText();
|
||||
text.setContent(node.textContent.trim() || '');
|
||||
text.translate(0, text._style.getLeading());
|
||||
if (!isNaN(fontSize)) text.setFontSize(fontSize);
|
||||
return text;
|
||||
} else {
|
||||
var lines = [];
|
||||
var spacing = 1.2;
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
var child = node.childNodes[i];
|
||||
if (!child.getAttribute) continue;
|
||||
lines.push(child.textContent);
|
||||
var dyString = child.getAttribute('dy');
|
||||
if (dyString) {
|
||||
var dy = parseFloat(dyString);
|
||||
if (!isNaN(dy)) {
|
||||
if (dyString.endsWith('em')) {
|
||||
spacing = dy;
|
||||
} else if (dyString.endsWith('px') && !isNaN(fontSize)) {
|
||||
spacing = dy / fontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var text = new PointText();
|
||||
if (!isNaN(fontSize)) text.setFontSize(fontSize);
|
||||
text.setLeading(text.fontSize * spacing);
|
||||
if (alignmentBaseline === 'text-before-edge') {
|
||||
text.setContent(' ');
|
||||
text.translate(0, text.bounds.height);
|
||||
}
|
||||
text.setContent(lines.join('\n'));
|
||||
return text;
|
||||
}
|
||||
},
|
||||
|
||||
switch: importGroup
|
||||
|
@ -15405,8 +15501,6 @@ new function() {
|
|||
}, {}), {
|
||||
id: function(item, value) {
|
||||
definitions[value] = item;
|
||||
if (item.setName)
|
||||
item.setName(value);
|
||||
},
|
||||
|
||||
'clip-path': function(item, value) {
|
||||
|
@ -15479,6 +15573,10 @@ new function() {
|
|||
if (matrix)
|
||||
group.transform(matrix);
|
||||
}
|
||||
},
|
||||
|
||||
'fill-rule': function(item, value) {
|
||||
if (value === 'evenodd' || value === 'nonzero') item.fillRule = value;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -15596,7 +15694,7 @@ new function() {
|
|||
var node = typeof svg === 'object'
|
||||
? svg
|
||||
: new self.DOMParser().parseFromString(
|
||||
svg.trim(),
|
||||
svg,
|
||||
'image/svg+xml'
|
||||
);
|
||||
if (!node.nodeName) {
|
||||
|
|
12
dist/paper-core.min.js
vendored
12
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
358
dist/paper-full.js
vendored
358
dist/paper-full.js
vendored
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Paper.js v0.12.15-develop - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* Paper.js v0.12.7 - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
||||
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Mon Mar 22 17:03:39 2021 +0100
|
||||
* Date: Thu Dec 1 12:02:03 2022 -0800
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -33,7 +33,7 @@
|
|||
var paper = function(self, undefined) {
|
||||
|
||||
self = self || require('./node/self.js');
|
||||
var window = self.window,
|
||||
var window = self.window ? self.window : self,
|
||||
document = self.document;
|
||||
|
||||
var Base = new function() {
|
||||
|
@ -821,7 +821,7 @@ var PaperScope = Base.extend({
|
|||
}
|
||||
},
|
||||
|
||||
version: "0.12.15-develop",
|
||||
version: "0.12.7",
|
||||
|
||||
getView: function() {
|
||||
var project = this.project;
|
||||
|
@ -3455,7 +3455,8 @@ new function() {
|
|||
}, Base.each({
|
||||
getStrokeBounds: { stroke: true },
|
||||
getHandleBounds: { handle: true },
|
||||
getInternalBounds: { internal: true }
|
||||
getInternalBounds: { internal: true },
|
||||
getDrawnBounds: { stroke: true, drawnTextBounds: true },
|
||||
},
|
||||
function(options, key) {
|
||||
this[key] = function(matrix) {
|
||||
|
@ -3512,6 +3513,7 @@ new function() {
|
|||
return [
|
||||
options.stroke ? 1 : 0,
|
||||
options.handle ? 1 : 0,
|
||||
options.drawnTextBounds? 1 : 0,
|
||||
internal ? 1 : 0
|
||||
].join('');
|
||||
},
|
||||
|
@ -3660,25 +3662,15 @@ new function() {
|
|||
var rotation = this.getRotation(),
|
||||
decomposed = this._decomposed,
|
||||
matrix = new Matrix(),
|
||||
isZero = Numerical.isZero;
|
||||
if (isZero(current.x) || isZero(current.y)) {
|
||||
matrix.translate(decomposed.translation);
|
||||
if (rotation) {
|
||||
matrix.rotate(rotation);
|
||||
}
|
||||
matrix.scale(scaling.x, scaling.y);
|
||||
this._matrix.set(matrix);
|
||||
} else {
|
||||
var center = this.getPosition(true);
|
||||
matrix.translate(center);
|
||||
if (rotation)
|
||||
matrix.rotate(rotation);
|
||||
matrix.scale(scaling.x / current.x, scaling.y / current.y);
|
||||
if (rotation)
|
||||
matrix.rotate(-rotation);
|
||||
matrix.translate(center.negate());
|
||||
this.transform(matrix);
|
||||
}
|
||||
center = this.getPosition(true);
|
||||
matrix.translate(center);
|
||||
if (rotation)
|
||||
matrix.rotate(rotation);
|
||||
matrix.scale(scaling.x / current.x, scaling.y / current.y);
|
||||
if (rotation)
|
||||
matrix.rotate(-rotation);
|
||||
matrix.translate(center.negate());
|
||||
this.transform(matrix);
|
||||
if (decomposed) {
|
||||
decomposed.scaling = scaling;
|
||||
this._decomposed = decomposed;
|
||||
|
@ -3692,7 +3684,7 @@ new function() {
|
|||
|
||||
setMatrix: function() {
|
||||
var matrix = this._matrix;
|
||||
matrix.set.apply(matrix, arguments);
|
||||
matrix.initialize.apply(matrix, arguments);
|
||||
},
|
||||
|
||||
getGlobalMatrix: function(_dontClone) {
|
||||
|
@ -3891,45 +3883,28 @@ new function() {
|
|||
this.setName(name);
|
||||
},
|
||||
|
||||
rasterize: function(arg0, arg1) {
|
||||
var resolution,
|
||||
insert,
|
||||
raster;
|
||||
if (Base.isPlainObject(arg0)) {
|
||||
resolution = arg0.resolution;
|
||||
insert = arg0.insert;
|
||||
raster = arg0.raster;
|
||||
} else {
|
||||
resolution = arg0;
|
||||
insert = arg1;
|
||||
}
|
||||
if (!raster) {
|
||||
raster = new Raster(Item.NO_INSERT);
|
||||
}
|
||||
var bounds = this.getStrokeBounds(),
|
||||
rasterize: function(resolution, insert, boundRect) {
|
||||
var bounds = boundRect ? boundRect : this.getStrokeBounds(),
|
||||
scale = (resolution || this.getView().getResolution()) / 72,
|
||||
topLeft = bounds.getTopLeft().floor(),
|
||||
bottomRight = bounds.getBottomRight().ceil(),
|
||||
boundsSize = new Size(bottomRight.subtract(topLeft)),
|
||||
rasterSize = boundsSize.multiply(scale);
|
||||
raster.setSize(rasterSize, true);
|
||||
|
||||
if (!rasterSize.isZero()) {
|
||||
var ctx = raster.getContext(true),
|
||||
size = new Size(bottomRight.subtract(topLeft)),
|
||||
raster = new Raster(Item.NO_INSERT);
|
||||
if (!size.isZero()) {
|
||||
var canvas = CanvasProvider.getCanvas(size.multiply(scale)),
|
||||
ctx = canvas.getContext('2d'),
|
||||
matrix = new Matrix().scale(scale).translate(topLeft.negate());
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
ctx.save();
|
||||
matrix.applyToContext(ctx);
|
||||
this.draw(ctx, new Base({ matrices: [matrix] }));
|
||||
ctx.restore();
|
||||
raster.setCanvas(canvas);
|
||||
}
|
||||
raster._matrix.set(
|
||||
new Matrix()
|
||||
.translate(topLeft.add(boundsSize.divide(2)))
|
||||
.scale(1 / scale)
|
||||
);
|
||||
if (insert === undefined || insert) {
|
||||
raster.transform(new Matrix().translate(topLeft.add(size.divide(2)))
|
||||
.scale(1 / scale));
|
||||
if (insert === undefined || insert)
|
||||
raster.insertAbove(this);
|
||||
}
|
||||
return raster;
|
||||
},
|
||||
|
||||
|
@ -4649,14 +4624,14 @@ new function() {
|
|||
}
|
||||
}), {
|
||||
|
||||
_setStyles: function(ctx, param, viewMatrix) {
|
||||
_setStyles: function(ctx, param, viewMatrix, strokeMatrix) {
|
||||
var style = this._style,
|
||||
matrix = this._matrix;
|
||||
if (style.hasFill()) {
|
||||
ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix);
|
||||
ctx.fillStyle = style.getFillColor().toCanvasStyle(ctx, matrix, strokeMatrix);
|
||||
}
|
||||
if (style.hasStroke()) {
|
||||
ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix);
|
||||
ctx.strokeStyle = style.getStrokeColor().toCanvasStyle(ctx, matrix, strokeMatrix);
|
||||
ctx.lineWidth = style.getStrokeWidth();
|
||||
var strokeJoin = style.getStrokeJoin(),
|
||||
strokeCap = style.getStrokeCap(),
|
||||
|
@ -4808,6 +4783,7 @@ new function() {
|
|||
half = size / 2;
|
||||
ctx.strokeStyle = ctx.fillStyle = color
|
||||
? color.toCanvasStyle(ctx) : '#009dec';
|
||||
ctx.lineWidth=2.5;
|
||||
if (itemSelected)
|
||||
this._drawSelected(ctx, mx, selectionItems);
|
||||
if (positionSelected) {
|
||||
|
@ -5200,7 +5176,7 @@ var Shape = Item.extend({
|
|||
ctx.closePath();
|
||||
}
|
||||
if (!dontPaint && (hasFill || hasStroke)) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
if (hasFill) {
|
||||
ctx.fill(style.getFillRule());
|
||||
ctx.shadowColor = 'rgba(0,0,0,0)';
|
||||
|
@ -5363,7 +5339,7 @@ var Raster = Item.extend({
|
|||
source: null
|
||||
},
|
||||
_prioritize: ['crossOrigin'],
|
||||
_smoothing: 'low',
|
||||
_smoothing: false,
|
||||
beans: true,
|
||||
|
||||
initialize: function Raster(source, position) {
|
||||
|
@ -5421,23 +5397,20 @@ var Raster = Item.extend({
|
|||
this, 'setSize');
|
||||
},
|
||||
|
||||
setSize: function(_size, _clear) {
|
||||
setSize: function() {
|
||||
var size = Size.read(arguments);
|
||||
if (!size.equals(this._size)) {
|
||||
if (size.width > 0 && size.height > 0) {
|
||||
var element = !_clear && this.getElement();
|
||||
var element = this.getElement();
|
||||
this._setImage(CanvasProvider.getCanvas(size));
|
||||
if (element) {
|
||||
if (element)
|
||||
this.getContext(true).drawImage(element, 0, 0,
|
||||
size.width, size.height);
|
||||
}
|
||||
} else {
|
||||
if (this._canvas)
|
||||
CanvasProvider.release(this._canvas);
|
||||
this._size = size.clone();
|
||||
}
|
||||
} else if (_clear) {
|
||||
this.clear();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -5590,9 +5563,7 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSmoothing: function(smoothing) {
|
||||
this._smoothing = typeof smoothing === 'string'
|
||||
? smoothing
|
||||
: smoothing ? 'low' : 'off';
|
||||
this._smoothing = smoothing;
|
||||
this._changed(257);
|
||||
},
|
||||
|
||||
|
@ -5605,8 +5576,16 @@ var Raster = Item.extend({
|
|||
getSubCanvas: function() {
|
||||
var rect = Rectangle.read(arguments),
|
||||
ctx = CanvasProvider.getContext(rect.getSize());
|
||||
ctx.drawImage(this.getCanvas(), rect.x, rect.y,
|
||||
rect.width, rect.height, 0, 0, rect.width, rect.height);
|
||||
var clippedStartX = Math.max(0, rect.x);
|
||||
var clippedStartY = Math.max(0, rect.y);
|
||||
var clippedEndX = Math.min(this.getCanvas().width, rect.x + rect.width);
|
||||
var clippedEndY = Math.min(this.getCanvas().height, rect.y + rect.height);
|
||||
ctx.drawImage(this.getCanvas(),
|
||||
clippedStartX, clippedStartY,
|
||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY,
|
||||
clippedStartX - rect.x, clippedStartY - rect.y,
|
||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY
|
||||
);
|
||||
return ctx.canvas;
|
||||
},
|
||||
|
||||
|
@ -5731,16 +5710,11 @@ var Raster = Item.extend({
|
|||
rect.width, rect.height);
|
||||
},
|
||||
|
||||
putImageData: function(data ) {
|
||||
setImageData: function(data ) {
|
||||
var point = Point.read(arguments, 1);
|
||||
this.getContext(true).putImageData(data, point.x, point.y);
|
||||
},
|
||||
|
||||
setImageData: function(data) {
|
||||
this.setSize(data);
|
||||
this.getContext(true).putImageData(data, 0, 0);
|
||||
},
|
||||
|
||||
_getBounds: function(matrix, options) {
|
||||
var rect = new Rectangle(this._size).setCenter(0, 0);
|
||||
return matrix ? matrix._transformBounds(rect) : rect;
|
||||
|
@ -5767,12 +5741,8 @@ var Raster = Item.extend({
|
|||
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
|
||||
var smoothing = this._smoothing,
|
||||
disabled = smoothing === 'off';
|
||||
DomElement.setPrefixed(
|
||||
ctx,
|
||||
disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality',
|
||||
disabled ? false : smoothing
|
||||
ctx, 'imageSmoothingEnabled', this._smoothing
|
||||
);
|
||||
|
||||
ctx.drawImage(element,
|
||||
|
@ -6842,13 +6812,13 @@ statics: {
|
|||
}
|
||||
|
||||
padding /= 2;
|
||||
var minPad = min[coord] + padding,
|
||||
maxPad = max[coord] - padding;
|
||||
var minPad = min[coord] - padding,
|
||||
maxPad = max[coord] + padding;
|
||||
if ( v0 < minPad || v1 < minPad || v2 < minPad || v3 < minPad ||
|
||||
v0 > maxPad || v1 > maxPad || v2 > maxPad || v3 > maxPad) {
|
||||
if (v1 < v0 != v1 < v3 && v2 < v0 != v2 < v3) {
|
||||
add(v0, 0);
|
||||
add(v3, 0);
|
||||
add(v0, padding);
|
||||
add(v3, padding);
|
||||
} else {
|
||||
var a = 3 * (v1 - v2) - v0 + v3,
|
||||
b = 2 * (v0 + v2) - 4 * v1,
|
||||
|
@ -9172,8 +9142,8 @@ var Path = PathItem.extend({
|
|||
strokePadding = tolerancePadding,
|
||||
join, cap, miterLimit,
|
||||
area, loc, res,
|
||||
hitStroke = options.stroke && style.hasStroke(),
|
||||
hitFill = options.fill && style.hasFill(),
|
||||
hitStroke = options.stroke && (style.hasStroke() || options.hitUnstrokedPaths),
|
||||
hitFill = options.fill && (style.hasFill() || options.hitUnfilledPaths),
|
||||
hitCurves = options.curves,
|
||||
strokeRadius = hitStroke
|
||||
? style.getStrokeWidth() / 2
|
||||
|
@ -9361,12 +9331,10 @@ var Path = PathItem.extend({
|
|||
}),
|
||||
new function() {
|
||||
|
||||
function drawHandles(ctx, segments, matrix, size) {
|
||||
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||
if (size <= 0) return;
|
||||
|
||||
var half = size / 2,
|
||||
miniSize = size - 2,
|
||||
miniHalf = half - 1,
|
||||
coords = new Array(6),
|
||||
pX, pY;
|
||||
|
||||
|
@ -9377,10 +9345,12 @@ new function() {
|
|||
ctx.beginPath();
|
||||
ctx.moveTo(pX, pY);
|
||||
ctx.lineTo(hX, hY);
|
||||
ctx.moveTo(hX - half, hY);
|
||||
ctx.lineTo(hX, hY + half);
|
||||
ctx.lineTo(hX + half, hY);
|
||||
ctx.lineTo(hX, hY - half);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9390,17 +9360,19 @@ new function() {
|
|||
segment._transformCoordinates(matrix, coords);
|
||||
pX = coords[0];
|
||||
pY = coords[1];
|
||||
if (selection & 2)
|
||||
if (selection & 2 && !isFullySelected)
|
||||
drawHandle(2);
|
||||
if (selection & 4)
|
||||
if (selection & 4 && !isFullySelected)
|
||||
drawHandle(4);
|
||||
ctx.fillRect(pX - half, pY - half, size, size);
|
||||
if (miniSize > 0 && !(selection & 1)) {
|
||||
var fillStyle = ctx.fillStyle;
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillRect(pX - miniHalf, pY - miniHalf, miniSize, miniSize);
|
||||
ctx.fillStyle = fillStyle;
|
||||
ctx.beginPath();
|
||||
ctx.arc(pX, pY, half, 0, Math.PI * 2, true);
|
||||
ctx.stroke();
|
||||
var fillStyle = ctx.fillStyle;
|
||||
if (!(selection & 1)) {
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||
}
|
||||
ctx.fill();
|
||||
ctx.fillStyle = fillStyle;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9486,7 +9458,7 @@ new function() {
|
|||
}
|
||||
|
||||
if (!dontPaint && (hasFill || hasStroke)) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
if (hasFill) {
|
||||
ctx.fill(style.getFillRule());
|
||||
ctx.shadowColor = 'rgba(0,0,0,0)';
|
||||
|
@ -9500,6 +9472,7 @@ new function() {
|
|||
length = flattener.length,
|
||||
from = -style.getDashOffset(), to,
|
||||
i = 0;
|
||||
from = from % length;
|
||||
while (from > 0) {
|
||||
from -= getOffset(i--) + getOffset(i--);
|
||||
}
|
||||
|
@ -9520,7 +9493,8 @@ new function() {
|
|||
ctx.beginPath();
|
||||
drawSegments(ctx, this, matrix);
|
||||
ctx.stroke();
|
||||
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize);
|
||||
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize,
|
||||
this.isFullySelected());
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -10240,7 +10214,7 @@ var CompoundPath = PathItem.extend({
|
|||
|
||||
_hitTestChildren: function _hitTestChildren(point, options, viewMatrix) {
|
||||
return _hitTestChildren.base.call(this, point,
|
||||
options.class === Path || options.type === 'path' ? options
|
||||
options.class === Path || options.type === 'path' || options.hitUnfilledPaths ? options
|
||||
: Base.set({}, options, { fill: false }),
|
||||
viewMatrix);
|
||||
},
|
||||
|
@ -10256,7 +10230,7 @@ var CompoundPath = PathItem.extend({
|
|||
children[i].draw(ctx, param, strokeMatrix);
|
||||
|
||||
if (!param.clip) {
|
||||
this._setStyles(ctx, param, viewMatrix);
|
||||
this._setStyles(ctx, param, viewMatrix, strokeMatrix);
|
||||
var style = this._style;
|
||||
if (style.hasFill()) {
|
||||
ctx.fill(style.getFillRule());
|
||||
|
@ -11628,6 +11602,11 @@ var PointText = TextItem.extend({
|
|||
},
|
||||
|
||||
_getBounds: function(matrix, options) {
|
||||
var rect = options.drawnTextBounds ? this._getDrawnTextSize() : this._getMeasuredTextSize();
|
||||
return matrix ? matrix._transformBounds(rect, rect) : rect;
|
||||
},
|
||||
|
||||
_getMeasuredTextSize: function() {
|
||||
var style = this._style,
|
||||
lines = this._lines,
|
||||
numLines = lines.length,
|
||||
|
@ -11637,10 +11616,67 @@ var PointText = TextItem.extend({
|
|||
x = 0;
|
||||
if (justification !== 'left')
|
||||
x -= width / (justification === 'center' ? 2: 1);
|
||||
var rect = new Rectangle(x,
|
||||
return new Rectangle(x,
|
||||
numLines ? - 0.75 * leading : 0,
|
||||
width, numLines * leading);
|
||||
return matrix ? matrix._transformBounds(rect, rect) : rect;
|
||||
},
|
||||
|
||||
_getDrawnTextSize: function() {
|
||||
var style = this._style;
|
||||
var lines = this._lines;
|
||||
var numLines = lines.length;
|
||||
var leading = style.getLeading();
|
||||
var justification = style.getJustification();
|
||||
|
||||
var svg = SvgElement.create('svg', {
|
||||
version: '1.1',
|
||||
xmlns: SvgElement.svg
|
||||
});
|
||||
var node = SvgElement.create('text');
|
||||
node.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
||||
svg.appendChild(node);
|
||||
for (var i = 0; i < numLines; i++) {
|
||||
var tspanNode = SvgElement.create('tspan', {
|
||||
x: '0',
|
||||
dy: i === 0 ? '0' : leading + 'px'
|
||||
});
|
||||
tspanNode.textContent = this._lines[i];
|
||||
node.appendChild(tspanNode);
|
||||
}
|
||||
|
||||
var element = document.createElement('span');
|
||||
element.style.visibility = ('hidden');
|
||||
element.style.whiteSpace = 'pre';
|
||||
element.style.fontSize = this.fontSize + 'px';
|
||||
element.style.fontFamily = this.font;
|
||||
element.style.lineHeight = this.leading / this.fontSize;
|
||||
|
||||
var bbox;
|
||||
try {
|
||||
element.appendChild(svg);
|
||||
document.body.appendChild(element);
|
||||
bbox = svg.getBBox();
|
||||
} finally {
|
||||
document.body.removeChild(element);
|
||||
}
|
||||
|
||||
var halfStrokeWidth = this.strokeWidth / 2;
|
||||
var width = bbox.width + (halfStrokeWidth * 2);
|
||||
var height = bbox.height + (halfStrokeWidth * 2);
|
||||
var x = bbox.x - halfStrokeWidth;
|
||||
var y = bbox.y - halfStrokeWidth;
|
||||
|
||||
if (justification !== 'left') {
|
||||
var eltWidth = this.getView().getTextWidth(style.getFontStyle(), lines);
|
||||
x -= eltWidth / (justification === 'center' ? 2: 1);
|
||||
}
|
||||
|
||||
return new Rectangle(x, y, width + 1, Math.max(height, numLines * leading));
|
||||
},
|
||||
|
||||
_hitTestSelf: function(point, options) {
|
||||
if (options.fill && (this.hasFill() || options.hitUnfilledPaths) && this._contains(point))
|
||||
return new HitResult('fill', this);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -12112,8 +12148,9 @@ var Color = Base.extend(new function() {
|
|||
+ components.join(',') + ')';
|
||||
},
|
||||
|
||||
toCanvasStyle: function(ctx, matrix) {
|
||||
if (this._canvasStyle)
|
||||
toCanvasStyle: function(ctx, matrix, strokeMatrix) {
|
||||
var strokeMayChange = this._type === 'gradient' && strokeMatrix;
|
||||
if (this._canvasStyle && !strokeMayChange)
|
||||
return this._canvasStyle;
|
||||
if (this._type !== 'gradient')
|
||||
return this._canvasStyle = this.toCSS();
|
||||
|
@ -12131,6 +12168,12 @@ var Color = Base.extend(new function() {
|
|||
if (highlight)
|
||||
highlight = inverse._transformPoint(highlight);
|
||||
}
|
||||
if (strokeMatrix) {
|
||||
origin = strokeMatrix._transformPoint(origin);
|
||||
destination = strokeMatrix._transformPoint(destination);
|
||||
if (highlight)
|
||||
highlight = strokeMatrix._transformPoint(highlight);
|
||||
}
|
||||
if (gradient._radial) {
|
||||
var radius = destination.getDistance(origin);
|
||||
if (highlight) {
|
||||
|
@ -12152,7 +12195,8 @@ var Color = Base.extend(new function() {
|
|||
offset == null ? i / (l - 1) : offset,
|
||||
stop._color.toCanvasStyle());
|
||||
}
|
||||
return this._canvasStyle = canvasGradient;
|
||||
if (!strokeMayChange) this._canvasStyle = canvasGradient;
|
||||
return canvasGradient;
|
||||
},
|
||||
|
||||
transform: function(matrix) {
|
||||
|
@ -13168,7 +13212,7 @@ var View = Base.extend(Emitter, {
|
|||
|
||||
setMatrix: function() {
|
||||
var matrix = this._matrix;
|
||||
matrix.set.apply(matrix, arguments);
|
||||
matrix.initialize.apply(matrix, arguments);
|
||||
},
|
||||
|
||||
transform: function(matrix) {
|
||||
|
@ -14062,7 +14106,7 @@ var Tween = Base.extend(Emitter, {
|
|||
_class: 'Tween',
|
||||
|
||||
statics: {
|
||||
easings: new Base({
|
||||
easings: {
|
||||
linear: function(t) {
|
||||
return t;
|
||||
},
|
||||
|
@ -14122,7 +14166,7 @@ var Tween = Base.extend(Emitter, {
|
|||
? 16 * t * t * t * t * t
|
||||
: 1 + 16 * (--t) * t * t * t * t;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function Tween(object, from, to, duration, easing, start) {
|
||||
|
@ -14168,7 +14212,7 @@ var Tween = Base.extend(Emitter, {
|
|||
|
||||
update: function(progress) {
|
||||
if (this.running) {
|
||||
if (progress >= 1) {
|
||||
if (progress > 1) {
|
||||
progress = 1;
|
||||
this.running = false;
|
||||
}
|
||||
|
@ -14190,15 +14234,15 @@ var Tween = Base.extend(Emitter, {
|
|||
this._setProperty(this._parsedKeys[key], value);
|
||||
}
|
||||
|
||||
if (!this.running && this._then) {
|
||||
this._then(this.object);
|
||||
}
|
||||
if (this.responds('update')) {
|
||||
this.emit('update', new Base({
|
||||
progress: progress,
|
||||
factor: factor
|
||||
}));
|
||||
}
|
||||
if (!this.running && this._then) {
|
||||
this._then(this.object);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
@ -14328,7 +14372,7 @@ var Http = {
|
|||
}
|
||||
};
|
||||
|
||||
var CanvasProvider = Base.exports.CanvasProvider = {
|
||||
var CanvasProvider = {
|
||||
canvases: [],
|
||||
|
||||
getCanvas: function(width, height) {
|
||||
|
@ -14896,7 +14940,7 @@ new function() {
|
|||
return SvgElement.create('use', attrs, formatter);
|
||||
}
|
||||
|
||||
function exportGradient(color) {
|
||||
function exportGradient(color, item) {
|
||||
var gradientNode = getDefinition(color, 'color');
|
||||
if (!gradientNode) {
|
||||
var gradient = color.getGradient(),
|
||||
|
@ -14923,6 +14967,11 @@ new function() {
|
|||
y2: destination.y
|
||||
};
|
||||
}
|
||||
if (item instanceof paper.PointText) {
|
||||
attrs.gradientTransform = getTransform(
|
||||
item._matrix.clone().invert(), false, formatter).transform;
|
||||
}
|
||||
|
||||
attrs.gradientUnits = 'userSpaceOnUse';
|
||||
gradientNode = SvgElement.create((radial ? 'radial' : 'linear')
|
||||
+ 'Gradient', attrs, formatter);
|
||||
|
@ -14948,9 +14997,18 @@ new function() {
|
|||
}
|
||||
|
||||
function exportText(item) {
|
||||
var node = SvgElement.create('text', getTransform(item._matrix, true),
|
||||
var node = SvgElement.create('text', getTransform(item._matrix, false),
|
||||
formatter);
|
||||
node.textContent = item._content;
|
||||
node.setAttribute('font-size', item.fontSize);
|
||||
node.setAttribute('xml:space', 'preserve');
|
||||
for (var i = 0; i < item._lines.length; i++) {
|
||||
var tspanNode = SvgElement.create('tspan', {
|
||||
x: '0',
|
||||
dy: i === 0 ? '0' : item.getLeading() + 'px'
|
||||
}, formatter);
|
||||
tspanNode.textContent = item._lines[i] ? item._lines[i] : ' ';
|
||||
node.appendChild(tspanNode);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -14977,9 +15035,13 @@ new function() {
|
|||
var get = entry.get,
|
||||
type = entry.type,
|
||||
value = item[get]();
|
||||
|
||||
if (value === undefined) return;
|
||||
|
||||
if (entry.exportFilter
|
||||
? entry.exportFilter(item, value)
|
||||
: !parent || !Base.equals(parent[get](), value)) {
|
||||
: !parent || !Base.equals(parent[get](), value) ||
|
||||
item instanceof paper.PointText) {
|
||||
if (type === 'color' && value != null) {
|
||||
var alpha = value.getAlpha();
|
||||
if (alpha < 1)
|
||||
|
@ -15089,7 +15151,7 @@ new function() {
|
|||
rect = bounds === 'view'
|
||||
? new Rectangle([0, 0], view.getViewSize())
|
||||
: bounds === 'content'
|
||||
? Item._getBounds(children, matrix, { stroke: true })
|
||||
? Item._getBounds(children, matrix, { stroke: true, drawnTextBounds: true })
|
||||
.rect
|
||||
: Rectangle.read([bounds], 0, { readNull: true }),
|
||||
attrs = {
|
||||
|
@ -15333,10 +15395,44 @@ new function() {
|
|||
},
|
||||
|
||||
text: function(node) {
|
||||
var text = new PointText(getPoint(node).add(
|
||||
getPoint(node, 'dx', 'dy')));
|
||||
text.setContent(node.textContent.trim() || '');
|
||||
return text;
|
||||
|
||||
var fontSize = parseFloat(node.getAttribute("font-size"));
|
||||
var alignmentBaseline = node.getAttribute("alignment-baseline");
|
||||
if (node.childElementCount === 0) {
|
||||
var text = new PointText();
|
||||
text.setContent(node.textContent.trim() || '');
|
||||
text.translate(0, text._style.getLeading());
|
||||
if (!isNaN(fontSize)) text.setFontSize(fontSize);
|
||||
return text;
|
||||
} else {
|
||||
var lines = [];
|
||||
var spacing = 1.2;
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
var child = node.childNodes[i];
|
||||
if (!child.getAttribute) continue;
|
||||
lines.push(child.textContent);
|
||||
var dyString = child.getAttribute('dy');
|
||||
if (dyString) {
|
||||
var dy = parseFloat(dyString);
|
||||
if (!isNaN(dy)) {
|
||||
if (dyString.endsWith('em')) {
|
||||
spacing = dy;
|
||||
} else if (dyString.endsWith('px') && !isNaN(fontSize)) {
|
||||
spacing = dy / fontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var text = new PointText();
|
||||
if (!isNaN(fontSize)) text.setFontSize(fontSize);
|
||||
text.setLeading(text.fontSize * spacing);
|
||||
if (alignmentBaseline === 'text-before-edge') {
|
||||
text.setContent(' ');
|
||||
text.translate(0, text.bounds.height);
|
||||
}
|
||||
text.setContent(lines.join('\n'));
|
||||
return text;
|
||||
}
|
||||
},
|
||||
|
||||
switch: importGroup
|
||||
|
@ -15408,8 +15504,6 @@ new function() {
|
|||
}, {}), {
|
||||
id: function(item, value) {
|
||||
definitions[value] = item;
|
||||
if (item.setName)
|
||||
item.setName(value);
|
||||
},
|
||||
|
||||
'clip-path': function(item, value) {
|
||||
|
@ -15482,6 +15576,10 @@ new function() {
|
|||
if (matrix)
|
||||
group.transform(matrix);
|
||||
}
|
||||
},
|
||||
|
||||
'fill-rule': function(item, value) {
|
||||
if (value === 'evenodd' || value === 'nonzero') item.fillRule = value;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -15599,7 +15697,7 @@ new function() {
|
|||
var node = typeof svg === 'object'
|
||||
? svg
|
||||
: new self.DOMParser().parseFromString(
|
||||
svg.trim(),
|
||||
svg,
|
||||
'image/svg+xml'
|
||||
);
|
||||
if (!node.nodeName) {
|
||||
|
|
13
dist/paper-full.min.js
vendored
13
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
683
dist/paper.d.ts
vendored
683
dist/paper.d.ts
vendored
File diff suppressed because it is too large
Load diff
3861
package-lock.json
generated
3861
package-lock.json
generated
File diff suppressed because it is too large
Load diff
98
package.json
98
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper",
|
||||
"version": "0.12.15",
|
||||
"name": "@scratch/paper",
|
||||
"version": "0.12.7",
|
||||
"description": "The Swiss Army Knife of Vector Graphics Scripting",
|
||||
"license": "MIT",
|
||||
"homepage": "http://paperjs.org",
|
||||
|
@ -9,110 +9,72 @@
|
|||
"url": "https://github.com/paperjs/paper.js"
|
||||
},
|
||||
"bugs": "https://github.com/paperjs/paper.js/issues",
|
||||
"contributors": [
|
||||
"Jürg Lehni <juerg@scratchdisk.com> (http://scratchdisk.com)",
|
||||
"Jonathan Puckey <jonathan@puckey.studio> (http://studiomoniker.com)"
|
||||
],
|
||||
"contributors": ["Jürg Lehni <juerg@scratchdisk.com> (http://scratchdisk.com)", "Jonathan Puckey <jonathan@puckey.studio> (http://studiomoniker.com)"],
|
||||
"main": "dist/paper-full.js",
|
||||
"types": "dist/paper.d.ts",
|
||||
"scripts": {
|
||||
"minify": "gulp minify",
|
||||
"build": "gulp build",
|
||||
"dist": "gulp dist",
|
||||
"zip": "gulp zip",
|
||||
"docs": "gulp docs",
|
||||
"publish": "gulp publish",
|
||||
"load": "gulp load",
|
||||
"jshint": "gulp jshint",
|
||||
"test": "gulp test",
|
||||
"test:browser": "gulp test:browser",
|
||||
"test:phantom": "gulp test:phantom",
|
||||
"test:node": "gulp test:node"
|
||||
"test": "gulp test"
|
||||
},
|
||||
"files": [
|
||||
"AUTHORS.md",
|
||||
"CHANGELOG.md",
|
||||
"dist/",
|
||||
"examples/",
|
||||
"LICENSE.txt",
|
||||
"README.md"
|
||||
],
|
||||
"files": ["AUTHORS.md", "CHANGELOG.md", "dist/", "examples/", "LICENSE.txt", "README.md"],
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "yarn jshint --ensure-branch develop",
|
||||
"pre-push": "yarn test --ensure-branch develop"
|
||||
"pre-commit": "gulp jshint --ensure-branch develop",
|
||||
"pre-push": "gulp test --ensure-branch develop"
|
||||
}
|
||||
},
|
||||
"browser": {
|
||||
"./dist/node/extend.js": false,
|
||||
"./dist/node/self.js": false,
|
||||
"canvas": false,
|
||||
"jsdom": false,
|
||||
"jsdom/lib/jsdom/living/generated/utils": false,
|
||||
"source-map-support": false
|
||||
"source-map-support": false,
|
||||
"./dist/node/self.js": false,
|
||||
"./dist/node/extend.js": false
|
||||
},
|
||||
"devDependencies": {
|
||||
"acorn": "~0.5.0",
|
||||
"ansi-colors": "^4.1.1",
|
||||
"canvas": "^2.7.0",
|
||||
"del": "^5.1.0",
|
||||
"fancy-log": "^1.3.3",
|
||||
"canvas": "^2.6.0",
|
||||
"del": "^4.1.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-cached": "^1.1.1",
|
||||
"gulp-cached": "^1.1.0",
|
||||
"gulp-git-streamed": "^2.10.1",
|
||||
"gulp-jshint": "^2.1.0",
|
||||
"gulp-json-modifier": "^1.0.0",
|
||||
"gulp-json-editor": "^2.5.2",
|
||||
"gulp-prepro": "^2.4.0",
|
||||
"gulp-qunits": "^2.1.2",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-shell": "^0.8.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-shell": "^0.7.0",
|
||||
"gulp-symlink": "^2.1.4",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"gulp-uncomment": "^0.3.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-webserver": "^0.9.1",
|
||||
"gulp-whitespace": "^0.1.0",
|
||||
"gulp-zip": "^5.1.0",
|
||||
"husky": "^4.3.8",
|
||||
"jsdom": "^16.5.1",
|
||||
"jshint": "^2.12.0",
|
||||
"gulp-zip": "^3.2.0",
|
||||
"husky": "^2.3.0",
|
||||
"jsdom": "^15.1.1",
|
||||
"jshint": "^2.10.2",
|
||||
"jshint-summary": "^0.4.0",
|
||||
"merge-stream": "^2.0.0",
|
||||
"minimist": "^1.2.5",
|
||||
"mustache": "^4.1.0",
|
||||
"minimist": "^1.2.0",
|
||||
"mustache": "^3.0.1",
|
||||
"prepro": "^2.4.0",
|
||||
"qunitjs": "^1.23.1",
|
||||
"qunitjs": "^1.23.0",
|
||||
"require-dir": "^1.2.0",
|
||||
"resemblejs": "^3.2.5",
|
||||
"resemblejs": "^3.1.0",
|
||||
"run-sequence": "^2.2.1",
|
||||
"source-map-support": "^0.5.19",
|
||||
"stats.js": "^0.17.0",
|
||||
"source-map-support": "^0.5.12",
|
||||
"stats.js": "0.17.0",
|
||||
"straps": "^3.0.1",
|
||||
"typescript": "^3.9.9"
|
||||
"typescript": "^3.1.6"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"graceful-fs": "4.2.2"
|
||||
},
|
||||
"keywords": [
|
||||
"vector",
|
||||
"graphic",
|
||||
"graphics",
|
||||
"2d",
|
||||
"geometry",
|
||||
"bezier",
|
||||
"curve",
|
||||
"curves",
|
||||
"path",
|
||||
"paths",
|
||||
"canvas",
|
||||
"svg",
|
||||
"paper",
|
||||
"paper.js",
|
||||
"paperjs"
|
||||
]
|
||||
"keywords": ["vector", "graphic", "graphics", "2d", "geometry", "bezier", "curve", "curves", "path", "paths", "canvas", "svg", "paper", "paper.js", "paperjs"]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue