mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Merge branch 'master' of https://github.com/paperjs/paper.js
This commit is contained in:
commit
89abb0992e
11 changed files with 9813 additions and 7534 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper",
|
"name": "paper",
|
||||||
"version": "0.9.15",
|
"version": "0.9.16",
|
||||||
"main": "dist/paper.js",
|
"main": "dist/paper.js",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"build",
|
"build",
|
||||||
|
|
|
@ -18,7 +18,7 @@ cd ..
|
||||||
PAPER_DIR=`PWD`
|
PAPER_DIR=`PWD`
|
||||||
cd ../paperjs.org
|
cd ../paperjs.org
|
||||||
SITE_DIR=`PWD`
|
SITE_DIR=`PWD`
|
||||||
DIST_FILE=content/10-Download/paperjs-v$VERSION.zip # Relative to $SITE_DIR
|
DIST_FILE=content/11-Download/paperjs-v$VERSION.zip # Relative to $SITE_DIR
|
||||||
|
|
||||||
cd $PAPER_DIR/build
|
cd $PAPER_DIR/build
|
||||||
./dist.sh
|
./dist.sh
|
||||||
|
@ -34,9 +34,9 @@ git commit -m "Bump version to v$VERSION"
|
||||||
# Tag
|
# Tag
|
||||||
git tag "v$VERSION"
|
git tag "v$VERSION"
|
||||||
# Push
|
# Push
|
||||||
git push --tags
|
git push --follow-tags
|
||||||
# Publish
|
# Publish
|
||||||
npm publish ..
|
npm publish
|
||||||
|
|
||||||
# Copy paperjs.zip to the website's download folder
|
# Copy paperjs.zip to the website's download folder
|
||||||
cd $SITE_DIR
|
cd $SITE_DIR
|
||||||
|
@ -47,6 +47,6 @@ git add -A $DIST_FILE
|
||||||
git commit -m "Release version v$VERSION"
|
git commit -m "Release version v$VERSION"
|
||||||
# Tag
|
# Tag
|
||||||
git tag "v$VERSION"
|
git tag "v$VERSION"
|
||||||
git push --tags
|
git push --follow-tags
|
||||||
|
|
||||||
cd "$PAPER_DIR/build"
|
cd "$PAPER_DIR/build"
|
||||||
|
|
4171
dist/paper-core.js
vendored
4171
dist/paper-core.js
vendored
File diff suppressed because it is too large
Load diff
26
dist/paper-core.min.js
vendored
26
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
4402
dist/paper-full.js
vendored
4402
dist/paper-full.js
vendored
File diff suppressed because one or more lines are too long
28
dist/paper-full.min.js
vendored
28
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
4183
dist/paper-node.js
vendored
4183
dist/paper-node.js
vendored
File diff suppressed because one or more lines are too long
4402
dist/paper.js
vendored
4402
dist/paper.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper",
|
"name": "paper",
|
||||||
"version": "0.9.15",
|
"version": "0.9.16",
|
||||||
"description": "The Swiss Army Knife of Vector Graphics Scripting",
|
"description": "The Swiss Army Knife of Vector Graphics Scripting",
|
||||||
"homepage": "http://paperjs.org",
|
"homepage": "http://paperjs.org",
|
||||||
"repository": "git://github.com/paperjs/paper.js",
|
"repository": "git://github.com/paperjs/paper.js",
|
||||||
|
|
|
@ -2296,7 +2296,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
},
|
},
|
||||||
|
|
||||||
arcTo: function(/* to, clockwise | through, to
|
arcTo: function(/* to, clockwise | through, to
|
||||||
| to, radius, rotation, large, sweep */) {
|
| to, radius, rotation, clockwise, large */) {
|
||||||
// Get the start point:
|
// Get the start point:
|
||||||
var current = getCurrentSegment(this),
|
var current = getCurrentSegment(this),
|
||||||
from = current._point,
|
from = current._point,
|
||||||
|
@ -2319,7 +2319,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
through = to;
|
through = to;
|
||||||
to = Point.read(arguments);
|
to = Point.read(arguments);
|
||||||
} else {
|
} else {
|
||||||
// #3: arcTo(to, radius, rotation, large, sweep)
|
// #3: arcTo(to, radius, rotation, clockwise, large)
|
||||||
// Drawing arcs in SVG style:
|
// Drawing arcs in SVG style:
|
||||||
var radius = Size.read(arguments);
|
var radius = Size.read(arguments);
|
||||||
// If rx = 0 or ry = 0 then this arc is treated as a
|
// If rx = 0 or ry = 0 then this arc is treated as a
|
||||||
|
@ -2329,8 +2329,8 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
// See for an explanation of the following calculations:
|
// See for an explanation of the following calculations:
|
||||||
// http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
// http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
||||||
var rotation = Base.read(arguments),
|
var rotation = Base.read(arguments),
|
||||||
|
clockwise = !!Base.read(arguments),
|
||||||
large = !!Base.read(arguments),
|
large = !!Base.read(arguments),
|
||||||
sweep = !!Base.read(arguments),
|
|
||||||
middle = from.add(to).divide(2),
|
middle = from.add(to).divide(2),
|
||||||
pt = from.subtract(middle).rotate(-rotation),
|
pt = from.subtract(middle).rotate(-rotation),
|
||||||
x = pt.x,
|
x = pt.x,
|
||||||
|
@ -2361,7 +2361,8 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
center = new Point(rx * y / ry, -ry * x / rx)
|
center = new Point(rx * y / ry, -ry * x / rx)
|
||||||
// "...where the + sign is chosen if fA != fS,
|
// "...where the + sign is chosen if fA != fS,
|
||||||
// and the − sign is chosen if fA = fS."
|
// and the − sign is chosen if fA = fS."
|
||||||
.multiply((large == sweep ? -1 : 1) * Math.sqrt(factor))
|
.multiply((large === clockwise ? -1 : 1)
|
||||||
|
* Math.sqrt(factor))
|
||||||
.rotate(rotation).add(middle);
|
.rotate(rotation).add(middle);
|
||||||
// Now create a matrix that maps the unit circle to the ellipse,
|
// Now create a matrix that maps the unit circle to the ellipse,
|
||||||
// for easier construction below.
|
// for easier construction below.
|
||||||
|
@ -2371,11 +2372,11 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
// and calculcate start vector and extend from there.
|
// and calculcate start vector and extend from there.
|
||||||
vector = matrix._inverseTransform(from);
|
vector = matrix._inverseTransform(from);
|
||||||
extent = vector.getDirectedAngle(matrix._inverseTransform(to));
|
extent = vector.getDirectedAngle(matrix._inverseTransform(to));
|
||||||
// "...in other words, if sweep = 0 and extent is > 0, subtract
|
// "...if fS = 0 and extent is > 0, then subtract 360, whereas
|
||||||
// 360, whereas if sweep = 1 and extent < 0, then add 360."
|
// if fS = 1 and extend is < 0, then add 360."
|
||||||
if (!sweep && extent > 0)
|
if (!clockwise && extent > 0)
|
||||||
extent -= 360;
|
extent -= 360;
|
||||||
else if (sweep && extent < 0)
|
else if (clockwise && extent < 0)
|
||||||
extent += 360;
|
extent += 360;
|
||||||
}
|
}
|
||||||
if (through) {
|
if (through) {
|
||||||
|
@ -2413,7 +2414,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
// If the center is on the same side of the line (from, to)
|
// If the center is on the same side of the line (from, to)
|
||||||
// as the through point, we're extending bellow 180 degrees
|
// as the through point, we're extending bellow 180 degrees
|
||||||
// and need to adapt extent.
|
// and need to adapt extent.
|
||||||
extent -= 360 * (extent < 0 ? -1 : 1);
|
extent += extent < 0 ? 360 : -360;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var ext = Math.abs(extent),
|
var ext = Math.abs(extent),
|
||||||
|
@ -2485,6 +2486,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
this.quadraticCurveTo(current.add(handle), current.add(to));
|
this.quadraticCurveTo(current.add(handle), current.add(to));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: Implement version for: (to, radius, rotation, clockwise, large)
|
||||||
arcBy: function(/* to, clockwise | through, to */) {
|
arcBy: function(/* to, clockwise | through, to */) {
|
||||||
var current = getCurrentSegment(this)._point,
|
var current = getCurrentSegment(this)._point,
|
||||||
point = current.add(Point.read(arguments)),
|
point = current.add(Point.read(arguments)),
|
||||||
|
|
|
@ -286,7 +286,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
||||||
for (var j = 0; j < length; j += 7) {
|
for (var j = 0; j < length; j += 7) {
|
||||||
this.arcTo(current = getPoint(j + 5),
|
this.arcTo(current = getPoint(j + 5),
|
||||||
new Size(+coords[0], +coords[1]),
|
new Size(+coords[0], +coords[1]),
|
||||||
+coords[2], +coords[3], +coords[4]);
|
+coords[2], +coords[4], +coords[3]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
|
@ -555,6 +555,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
||||||
* myPath.arcTo(event.point);
|
* myPath.arcTo(event.point);
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
// DOCS: PathItem#arcTo(to, radius, rotation, clockwise, large)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the path. When closed, Paper.js connects the first and last
|
* Closes the path. When closed, Paper.js connects the first and last
|
||||||
|
|
Loading…
Reference in a new issue