mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Prebuilt module for commit d9e09b9d20
This commit is contained in:
parent
1dc637690a
commit
429e8e3d3a
5 changed files with 87 additions and 84 deletions
53
dist/docs/assets/js/paper.js
vendored
53
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Wed Feb 10 18:13:13 2016 +0100
|
||||
* Date: Wed Feb 10 18:23:56 2016 +0100
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -13344,7 +13344,7 @@ new function() {
|
|||
|
||||
var rootSize;
|
||||
|
||||
function getValue(node, name, isString, allowNull) {
|
||||
function getValue(node, name, isString, allowNull, allowPercent) {
|
||||
var value = SvgElement.get(node, name),
|
||||
res = value == null
|
||||
? allowNull
|
||||
|
@ -13354,21 +13354,21 @@ new function() {
|
|||
? value
|
||||
: parseFloat(value);
|
||||
return /%\s*$/.test(value)
|
||||
? (res / 100) * (rootSize ? rootSize[
|
||||
/x|^width/.test(name) ? 'width' : 'height'] : 1)
|
||||
? (res / 100) * (allowPercent ? 1
|
||||
: rootSize[/x|^width/.test(name) ? 'width' : 'height'])
|
||||
: res;
|
||||
}
|
||||
|
||||
function getPoint(node, x, y, allowNull) {
|
||||
x = getValue(node, x || 'x', false, allowNull);
|
||||
y = getValue(node, y || 'y', false, allowNull);
|
||||
function getPoint(node, x, y, allowNull, allowPercent) {
|
||||
x = getValue(node, x || 'x', false, allowNull, allowPercent);
|
||||
y = getValue(node, y || 'y', false, allowNull, allowPercent);
|
||||
return allowNull && (x == null || y == null) ? null
|
||||
: new Point(x, y);
|
||||
}
|
||||
|
||||
function getSize(node, w, h, allowNull) {
|
||||
w = getValue(node, w || 'width', false, allowNull);
|
||||
h = getValue(node, h || 'height', false, allowNull);
|
||||
function getSize(node, w, h, allowNull, allowPercent) {
|
||||
w = getValue(node, w || 'width', false, allowNull, allowPercent);
|
||||
h = getValue(node, h || 'height', false, allowNull, allowPercent);
|
||||
return allowNull && (w == null || h == null) ? null
|
||||
: new Size(w, h);
|
||||
}
|
||||
|
@ -13444,15 +13444,14 @@ new function() {
|
|||
|
||||
function importGradient(node, type) {
|
||||
var id = (getValue(node, 'href', true) || '').substring(1),
|
||||
isRadial = type === 'radialgradient',
|
||||
gradient,
|
||||
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||
'userSpaceOnUse';
|
||||
prevSize = rootSize;
|
||||
if (scaleToBounds)
|
||||
rootSize = null;
|
||||
radial = type === 'radialgradient',
|
||||
gradient;
|
||||
if (id) {
|
||||
gradient = definitions[id].getGradient();
|
||||
if (gradient._radial ^ radial) {
|
||||
gradient = gradient.clone();
|
||||
gradient._radial = radial;
|
||||
}
|
||||
} else {
|
||||
var nodes = node.childNodes,
|
||||
stops = [];
|
||||
|
@ -13461,21 +13460,23 @@ new function() {
|
|||
if (child.nodeType === 1)
|
||||
stops.push(applyAttributes(new GradientStop(), child));
|
||||
}
|
||||
gradient = new Gradient(stops, isRadial);
|
||||
gradient = new Gradient(stops, radial);
|
||||
}
|
||||
var origin, destination, highlight;
|
||||
if (isRadial) {
|
||||
origin = getPoint(node, 'cx', 'cy');
|
||||
destination = origin.add(getValue(node, 'r'), 0);
|
||||
highlight = getPoint(node, 'fx', 'fy', true);
|
||||
var origin, destination, highlight,
|
||||
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||
'userSpaceOnUse';
|
||||
if (radial) {
|
||||
origin = getPoint(node, 'cx', 'cy', false, scaleToBounds);
|
||||
destination = origin.add(
|
||||
getValue(node, 'r', false, false, scaleToBounds), 0);
|
||||
highlight = getPoint(node, 'fx', 'fy', true, scaleToBounds);
|
||||
} else {
|
||||
origin = getPoint(node, 'x1', 'y1');
|
||||
destination = getPoint(node, 'x2', 'y2');
|
||||
origin = getPoint(node, 'x1', 'y1', false, scaleToBounds);
|
||||
destination = getPoint(node, 'x2', 'y2', false, scaleToBounds);
|
||||
}
|
||||
var color = applyAttributes(
|
||||
new Color(gradient, origin, destination, highlight), node);
|
||||
color._scaleToBounds = scaleToBounds;
|
||||
rootSize = prevSize;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
53
dist/paper-core.js
vendored
53
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Wed Feb 10 18:13:13 2016 +0100
|
||||
* Date: Wed Feb 10 18:23:56 2016 +0100
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -13344,7 +13344,7 @@ new function() {
|
|||
|
||||
var rootSize;
|
||||
|
||||
function getValue(node, name, isString, allowNull) {
|
||||
function getValue(node, name, isString, allowNull, allowPercent) {
|
||||
var value = SvgElement.get(node, name),
|
||||
res = value == null
|
||||
? allowNull
|
||||
|
@ -13354,21 +13354,21 @@ new function() {
|
|||
? value
|
||||
: parseFloat(value);
|
||||
return /%\s*$/.test(value)
|
||||
? (res / 100) * (rootSize ? rootSize[
|
||||
/x|^width/.test(name) ? 'width' : 'height'] : 1)
|
||||
? (res / 100) * (allowPercent ? 1
|
||||
: rootSize[/x|^width/.test(name) ? 'width' : 'height'])
|
||||
: res;
|
||||
}
|
||||
|
||||
function getPoint(node, x, y, allowNull) {
|
||||
x = getValue(node, x || 'x', false, allowNull);
|
||||
y = getValue(node, y || 'y', false, allowNull);
|
||||
function getPoint(node, x, y, allowNull, allowPercent) {
|
||||
x = getValue(node, x || 'x', false, allowNull, allowPercent);
|
||||
y = getValue(node, y || 'y', false, allowNull, allowPercent);
|
||||
return allowNull && (x == null || y == null) ? null
|
||||
: new Point(x, y);
|
||||
}
|
||||
|
||||
function getSize(node, w, h, allowNull) {
|
||||
w = getValue(node, w || 'width', false, allowNull);
|
||||
h = getValue(node, h || 'height', false, allowNull);
|
||||
function getSize(node, w, h, allowNull, allowPercent) {
|
||||
w = getValue(node, w || 'width', false, allowNull, allowPercent);
|
||||
h = getValue(node, h || 'height', false, allowNull, allowPercent);
|
||||
return allowNull && (w == null || h == null) ? null
|
||||
: new Size(w, h);
|
||||
}
|
||||
|
@ -13444,15 +13444,14 @@ new function() {
|
|||
|
||||
function importGradient(node, type) {
|
||||
var id = (getValue(node, 'href', true) || '').substring(1),
|
||||
isRadial = type === 'radialgradient',
|
||||
gradient,
|
||||
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||
'userSpaceOnUse';
|
||||
prevSize = rootSize;
|
||||
if (scaleToBounds)
|
||||
rootSize = null;
|
||||
radial = type === 'radialgradient',
|
||||
gradient;
|
||||
if (id) {
|
||||
gradient = definitions[id].getGradient();
|
||||
if (gradient._radial ^ radial) {
|
||||
gradient = gradient.clone();
|
||||
gradient._radial = radial;
|
||||
}
|
||||
} else {
|
||||
var nodes = node.childNodes,
|
||||
stops = [];
|
||||
|
@ -13461,21 +13460,23 @@ new function() {
|
|||
if (child.nodeType === 1)
|
||||
stops.push(applyAttributes(new GradientStop(), child));
|
||||
}
|
||||
gradient = new Gradient(stops, isRadial);
|
||||
gradient = new Gradient(stops, radial);
|
||||
}
|
||||
var origin, destination, highlight;
|
||||
if (isRadial) {
|
||||
origin = getPoint(node, 'cx', 'cy');
|
||||
destination = origin.add(getValue(node, 'r'), 0);
|
||||
highlight = getPoint(node, 'fx', 'fy', true);
|
||||
var origin, destination, highlight,
|
||||
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||
'userSpaceOnUse';
|
||||
if (radial) {
|
||||
origin = getPoint(node, 'cx', 'cy', false, scaleToBounds);
|
||||
destination = origin.add(
|
||||
getValue(node, 'r', false, false, scaleToBounds), 0);
|
||||
highlight = getPoint(node, 'fx', 'fy', true, scaleToBounds);
|
||||
} else {
|
||||
origin = getPoint(node, 'x1', 'y1');
|
||||
destination = getPoint(node, 'x2', 'y2');
|
||||
origin = getPoint(node, 'x1', 'y1', false, scaleToBounds);
|
||||
destination = getPoint(node, 'x2', 'y2', false, scaleToBounds);
|
||||
}
|
||||
var color = applyAttributes(
|
||||
new Color(gradient, origin, destination, highlight), node);
|
||||
color._scaleToBounds = scaleToBounds;
|
||||
rootSize = prevSize;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
6
dist/paper-core.min.js
vendored
6
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
53
dist/paper-full.js
vendored
53
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Wed Feb 10 18:13:13 2016 +0100
|
||||
* Date: Wed Feb 10 18:23:56 2016 +0100
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -13344,7 +13344,7 @@ new function() {
|
|||
|
||||
var rootSize;
|
||||
|
||||
function getValue(node, name, isString, allowNull) {
|
||||
function getValue(node, name, isString, allowNull, allowPercent) {
|
||||
var value = SvgElement.get(node, name),
|
||||
res = value == null
|
||||
? allowNull
|
||||
|
@ -13354,21 +13354,21 @@ new function() {
|
|||
? value
|
||||
: parseFloat(value);
|
||||
return /%\s*$/.test(value)
|
||||
? (res / 100) * (rootSize ? rootSize[
|
||||
/x|^width/.test(name) ? 'width' : 'height'] : 1)
|
||||
? (res / 100) * (allowPercent ? 1
|
||||
: rootSize[/x|^width/.test(name) ? 'width' : 'height'])
|
||||
: res;
|
||||
}
|
||||
|
||||
function getPoint(node, x, y, allowNull) {
|
||||
x = getValue(node, x || 'x', false, allowNull);
|
||||
y = getValue(node, y || 'y', false, allowNull);
|
||||
function getPoint(node, x, y, allowNull, allowPercent) {
|
||||
x = getValue(node, x || 'x', false, allowNull, allowPercent);
|
||||
y = getValue(node, y || 'y', false, allowNull, allowPercent);
|
||||
return allowNull && (x == null || y == null) ? null
|
||||
: new Point(x, y);
|
||||
}
|
||||
|
||||
function getSize(node, w, h, allowNull) {
|
||||
w = getValue(node, w || 'width', false, allowNull);
|
||||
h = getValue(node, h || 'height', false, allowNull);
|
||||
function getSize(node, w, h, allowNull, allowPercent) {
|
||||
w = getValue(node, w || 'width', false, allowNull, allowPercent);
|
||||
h = getValue(node, h || 'height', false, allowNull, allowPercent);
|
||||
return allowNull && (w == null || h == null) ? null
|
||||
: new Size(w, h);
|
||||
}
|
||||
|
@ -13444,15 +13444,14 @@ new function() {
|
|||
|
||||
function importGradient(node, type) {
|
||||
var id = (getValue(node, 'href', true) || '').substring(1),
|
||||
isRadial = type === 'radialgradient',
|
||||
gradient,
|
||||
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||
'userSpaceOnUse';
|
||||
prevSize = rootSize;
|
||||
if (scaleToBounds)
|
||||
rootSize = null;
|
||||
radial = type === 'radialgradient',
|
||||
gradient;
|
||||
if (id) {
|
||||
gradient = definitions[id].getGradient();
|
||||
if (gradient._radial ^ radial) {
|
||||
gradient = gradient.clone();
|
||||
gradient._radial = radial;
|
||||
}
|
||||
} else {
|
||||
var nodes = node.childNodes,
|
||||
stops = [];
|
||||
|
@ -13461,21 +13460,23 @@ new function() {
|
|||
if (child.nodeType === 1)
|
||||
stops.push(applyAttributes(new GradientStop(), child));
|
||||
}
|
||||
gradient = new Gradient(stops, isRadial);
|
||||
gradient = new Gradient(stops, radial);
|
||||
}
|
||||
var origin, destination, highlight;
|
||||
if (isRadial) {
|
||||
origin = getPoint(node, 'cx', 'cy');
|
||||
destination = origin.add(getValue(node, 'r'), 0);
|
||||
highlight = getPoint(node, 'fx', 'fy', true);
|
||||
var origin, destination, highlight,
|
||||
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||
'userSpaceOnUse';
|
||||
if (radial) {
|
||||
origin = getPoint(node, 'cx', 'cy', false, scaleToBounds);
|
||||
destination = origin.add(
|
||||
getValue(node, 'r', false, false, scaleToBounds), 0);
|
||||
highlight = getPoint(node, 'fx', 'fy', true, scaleToBounds);
|
||||
} else {
|
||||
origin = getPoint(node, 'x1', 'y1');
|
||||
destination = getPoint(node, 'x2', 'y2');
|
||||
origin = getPoint(node, 'x1', 'y1', false, scaleToBounds);
|
||||
destination = getPoint(node, 'x2', 'y2', false, scaleToBounds);
|
||||
}
|
||||
var color = applyAttributes(
|
||||
new Color(gradient, origin, destination, highlight), node);
|
||||
color._scaleToBounds = scaleToBounds;
|
||||
rootSize = prevSize;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
6
dist/paper-full.min.js
vendored
6
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue