mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-09 06:12:34 -05:00
Prebuilt module for commit fce126959d
This commit is contained in:
parent
e8deeadbe0
commit
61093845fe
5 changed files with 96 additions and 41 deletions
40
dist/docs/assets/js/paper.js
vendored
40
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Wed Feb 10 16:15:35 2016 +0100
|
* Date: Wed Feb 10 17:46:39 2016 +0100
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -13353,8 +13353,9 @@ new function() {
|
||||||
: isString
|
: isString
|
||||||
? value
|
? value
|
||||||
: parseFloat(value);
|
: parseFloat(value);
|
||||||
return rootSize && /%\s*$/.test(value)
|
return /%\s*$/.test(value)
|
||||||
? rootSize[/x|^width/.test(name) ? 'width' : 'height'] * res / 100
|
? (res / 100) * (rootSize ? rootSize[
|
||||||
|
/x|^width/.test(name) ? 'width' : 'height'] : 1)
|
||||||
: res;
|
: res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13444,7 +13445,12 @@ new function() {
|
||||||
function importGradient(node, type) {
|
function importGradient(node, type) {
|
||||||
var id = (getValue(node, 'href', true) || '').substring(1),
|
var id = (getValue(node, 'href', true) || '').substring(1),
|
||||||
isRadial = type === 'radialgradient',
|
isRadial = type === 'radialgradient',
|
||||||
gradient;
|
gradient,
|
||||||
|
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||||
|
'userSpaceOnUse';
|
||||||
|
prevSize = rootSize;
|
||||||
|
if (scaleToBounds)
|
||||||
|
rootSize = null;
|
||||||
if (id) {
|
if (id) {
|
||||||
gradient = definitions[id].getGradient();
|
gradient = definitions[id].getGradient();
|
||||||
} else {
|
} else {
|
||||||
|
@ -13466,8 +13472,10 @@ new function() {
|
||||||
origin = getPoint(node, 'x1', 'y1');
|
origin = getPoint(node, 'x1', 'y1');
|
||||||
destination = getPoint(node, 'x2', 'y2');
|
destination = getPoint(node, 'x2', 'y2');
|
||||||
}
|
}
|
||||||
applyAttributes(
|
var color = applyAttributes(
|
||||||
new Color(gradient, origin, destination, highlight), node);
|
new Color(gradient, origin, destination, highlight), node);
|
||||||
|
color._scaleToBounds = scaleToBounds;
|
||||||
|
rootSize = prevSize;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13619,11 +13627,20 @@ new function() {
|
||||||
var attributes = Base.set(Base.each(SvgStyles, function(entry) {
|
var attributes = Base.set(Base.each(SvgStyles, function(entry) {
|
||||||
this[entry.attribute] = function(item, value) {
|
this[entry.attribute] = function(item, value) {
|
||||||
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
|
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
|
||||||
if (entry.type === 'color' && item instanceof Shape) {
|
if (entry.type === 'color') {
|
||||||
var color = item[entry.get]();
|
var color = item[entry.get]();
|
||||||
if (color)
|
if (color) {
|
||||||
color.transform(new Matrix().translate(
|
if (color._scaleToBounds) {
|
||||||
item.getPosition(true).negate()));
|
var bounds = item.getBounds();
|
||||||
|
color.transform(new Matrix()
|
||||||
|
.translate(bounds.getPoint())
|
||||||
|
.scale(bounds.getSize()));
|
||||||
|
}
|
||||||
|
if (item instanceof Shape) {
|
||||||
|
color.transform(new Matrix()
|
||||||
|
.translate(item.getPosition(true).negate()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, {}), {
|
}, {}), {
|
||||||
|
@ -13741,8 +13758,7 @@ new function() {
|
||||||
function onLoadCallback(svg) {
|
function onLoadCallback(svg) {
|
||||||
paper = scope;
|
paper = scope;
|
||||||
var item = importSVG(svg, options, isRoot),
|
var item = importSVG(svg, options, isRoot),
|
||||||
onLoad = options.onLoad,
|
onLoad = options.onLoad;
|
||||||
view = scope.project && scope.getView();
|
|
||||||
if (onLoad)
|
if (onLoad)
|
||||||
onLoad.call(this, item, svg);
|
onLoad.call(this, item, svg);
|
||||||
}
|
}
|
||||||
|
@ -13775,6 +13791,8 @@ new function() {
|
||||||
data = node.getAttribute && node.getAttribute('data-paper-data'),
|
data = node.getAttribute && node.getAttribute('data-paper-data'),
|
||||||
settings = scope.settings,
|
settings = scope.settings,
|
||||||
applyMatrix = settings.applyMatrix;
|
applyMatrix = settings.applyMatrix;
|
||||||
|
if (isRoot)
|
||||||
|
rootSize = scope.getView().getSize();
|
||||||
settings.applyMatrix = false;
|
settings.applyMatrix = false;
|
||||||
item = importer && importer(node, type, options, isRoot) || null;
|
item = importer && importer(node, type, options, isRoot) || null;
|
||||||
settings.applyMatrix = applyMatrix;
|
settings.applyMatrix = applyMatrix;
|
||||||
|
|
40
dist/paper-core.js
vendored
40
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Wed Feb 10 16:15:35 2016 +0100
|
* Date: Wed Feb 10 17:46:39 2016 +0100
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -13353,8 +13353,9 @@ new function() {
|
||||||
: isString
|
: isString
|
||||||
? value
|
? value
|
||||||
: parseFloat(value);
|
: parseFloat(value);
|
||||||
return rootSize && /%\s*$/.test(value)
|
return /%\s*$/.test(value)
|
||||||
? rootSize[/x|^width/.test(name) ? 'width' : 'height'] * res / 100
|
? (res / 100) * (rootSize ? rootSize[
|
||||||
|
/x|^width/.test(name) ? 'width' : 'height'] : 1)
|
||||||
: res;
|
: res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13444,7 +13445,12 @@ new function() {
|
||||||
function importGradient(node, type) {
|
function importGradient(node, type) {
|
||||||
var id = (getValue(node, 'href', true) || '').substring(1),
|
var id = (getValue(node, 'href', true) || '').substring(1),
|
||||||
isRadial = type === 'radialgradient',
|
isRadial = type === 'radialgradient',
|
||||||
gradient;
|
gradient,
|
||||||
|
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||||
|
'userSpaceOnUse';
|
||||||
|
prevSize = rootSize;
|
||||||
|
if (scaleToBounds)
|
||||||
|
rootSize = null;
|
||||||
if (id) {
|
if (id) {
|
||||||
gradient = definitions[id].getGradient();
|
gradient = definitions[id].getGradient();
|
||||||
} else {
|
} else {
|
||||||
|
@ -13466,8 +13472,10 @@ new function() {
|
||||||
origin = getPoint(node, 'x1', 'y1');
|
origin = getPoint(node, 'x1', 'y1');
|
||||||
destination = getPoint(node, 'x2', 'y2');
|
destination = getPoint(node, 'x2', 'y2');
|
||||||
}
|
}
|
||||||
applyAttributes(
|
var color = applyAttributes(
|
||||||
new Color(gradient, origin, destination, highlight), node);
|
new Color(gradient, origin, destination, highlight), node);
|
||||||
|
color._scaleToBounds = scaleToBounds;
|
||||||
|
rootSize = prevSize;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13619,11 +13627,20 @@ new function() {
|
||||||
var attributes = Base.set(Base.each(SvgStyles, function(entry) {
|
var attributes = Base.set(Base.each(SvgStyles, function(entry) {
|
||||||
this[entry.attribute] = function(item, value) {
|
this[entry.attribute] = function(item, value) {
|
||||||
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
|
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
|
||||||
if (entry.type === 'color' && item instanceof Shape) {
|
if (entry.type === 'color') {
|
||||||
var color = item[entry.get]();
|
var color = item[entry.get]();
|
||||||
if (color)
|
if (color) {
|
||||||
color.transform(new Matrix().translate(
|
if (color._scaleToBounds) {
|
||||||
item.getPosition(true).negate()));
|
var bounds = item.getBounds();
|
||||||
|
color.transform(new Matrix()
|
||||||
|
.translate(bounds.getPoint())
|
||||||
|
.scale(bounds.getSize()));
|
||||||
|
}
|
||||||
|
if (item instanceof Shape) {
|
||||||
|
color.transform(new Matrix()
|
||||||
|
.translate(item.getPosition(true).negate()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, {}), {
|
}, {}), {
|
||||||
|
@ -13741,8 +13758,7 @@ new function() {
|
||||||
function onLoadCallback(svg) {
|
function onLoadCallback(svg) {
|
||||||
paper = scope;
|
paper = scope;
|
||||||
var item = importSVG(svg, options, isRoot),
|
var item = importSVG(svg, options, isRoot),
|
||||||
onLoad = options.onLoad,
|
onLoad = options.onLoad;
|
||||||
view = scope.project && scope.getView();
|
|
||||||
if (onLoad)
|
if (onLoad)
|
||||||
onLoad.call(this, item, svg);
|
onLoad.call(this, item, svg);
|
||||||
}
|
}
|
||||||
|
@ -13775,6 +13791,8 @@ new function() {
|
||||||
data = node.getAttribute && node.getAttribute('data-paper-data'),
|
data = node.getAttribute && node.getAttribute('data-paper-data'),
|
||||||
settings = scope.settings,
|
settings = scope.settings,
|
||||||
applyMatrix = settings.applyMatrix;
|
applyMatrix = settings.applyMatrix;
|
||||||
|
if (isRoot)
|
||||||
|
rootSize = scope.getView().getSize();
|
||||||
settings.applyMatrix = false;
|
settings.applyMatrix = false;
|
||||||
item = importer && importer(node, type, options, isRoot) || null;
|
item = importer && importer(node, type, options, isRoot) || null;
|
||||||
settings.applyMatrix = applyMatrix;
|
settings.applyMatrix = applyMatrix;
|
||||||
|
|
11
dist/paper-core.min.js
vendored
11
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
40
dist/paper-full.js
vendored
40
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Wed Feb 10 16:15:35 2016 +0100
|
* Date: Wed Feb 10 17:46:39 2016 +0100
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -13353,8 +13353,9 @@ new function() {
|
||||||
: isString
|
: isString
|
||||||
? value
|
? value
|
||||||
: parseFloat(value);
|
: parseFloat(value);
|
||||||
return rootSize && /%\s*$/.test(value)
|
return /%\s*$/.test(value)
|
||||||
? rootSize[/x|^width/.test(name) ? 'width' : 'height'] * res / 100
|
? (res / 100) * (rootSize ? rootSize[
|
||||||
|
/x|^width/.test(name) ? 'width' : 'height'] : 1)
|
||||||
: res;
|
: res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13444,7 +13445,12 @@ new function() {
|
||||||
function importGradient(node, type) {
|
function importGradient(node, type) {
|
||||||
var id = (getValue(node, 'href', true) || '').substring(1),
|
var id = (getValue(node, 'href', true) || '').substring(1),
|
||||||
isRadial = type === 'radialgradient',
|
isRadial = type === 'radialgradient',
|
||||||
gradient;
|
gradient,
|
||||||
|
scaleToBounds = getValue(node, 'gradientUnits', true) !==
|
||||||
|
'userSpaceOnUse';
|
||||||
|
prevSize = rootSize;
|
||||||
|
if (scaleToBounds)
|
||||||
|
rootSize = null;
|
||||||
if (id) {
|
if (id) {
|
||||||
gradient = definitions[id].getGradient();
|
gradient = definitions[id].getGradient();
|
||||||
} else {
|
} else {
|
||||||
|
@ -13466,8 +13472,10 @@ new function() {
|
||||||
origin = getPoint(node, 'x1', 'y1');
|
origin = getPoint(node, 'x1', 'y1');
|
||||||
destination = getPoint(node, 'x2', 'y2');
|
destination = getPoint(node, 'x2', 'y2');
|
||||||
}
|
}
|
||||||
applyAttributes(
|
var color = applyAttributes(
|
||||||
new Color(gradient, origin, destination, highlight), node);
|
new Color(gradient, origin, destination, highlight), node);
|
||||||
|
color._scaleToBounds = scaleToBounds;
|
||||||
|
rootSize = prevSize;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13619,11 +13627,20 @@ new function() {
|
||||||
var attributes = Base.set(Base.each(SvgStyles, function(entry) {
|
var attributes = Base.set(Base.each(SvgStyles, function(entry) {
|
||||||
this[entry.attribute] = function(item, value) {
|
this[entry.attribute] = function(item, value) {
|
||||||
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
|
item[entry.set](convertValue(value, entry.type, entry.fromSVG));
|
||||||
if (entry.type === 'color' && item instanceof Shape) {
|
if (entry.type === 'color') {
|
||||||
var color = item[entry.get]();
|
var color = item[entry.get]();
|
||||||
if (color)
|
if (color) {
|
||||||
color.transform(new Matrix().translate(
|
if (color._scaleToBounds) {
|
||||||
item.getPosition(true).negate()));
|
var bounds = item.getBounds();
|
||||||
|
color.transform(new Matrix()
|
||||||
|
.translate(bounds.getPoint())
|
||||||
|
.scale(bounds.getSize()));
|
||||||
|
}
|
||||||
|
if (item instanceof Shape) {
|
||||||
|
color.transform(new Matrix()
|
||||||
|
.translate(item.getPosition(true).negate()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, {}), {
|
}, {}), {
|
||||||
|
@ -13741,8 +13758,7 @@ new function() {
|
||||||
function onLoadCallback(svg) {
|
function onLoadCallback(svg) {
|
||||||
paper = scope;
|
paper = scope;
|
||||||
var item = importSVG(svg, options, isRoot),
|
var item = importSVG(svg, options, isRoot),
|
||||||
onLoad = options.onLoad,
|
onLoad = options.onLoad;
|
||||||
view = scope.project && scope.getView();
|
|
||||||
if (onLoad)
|
if (onLoad)
|
||||||
onLoad.call(this, item, svg);
|
onLoad.call(this, item, svg);
|
||||||
}
|
}
|
||||||
|
@ -13775,6 +13791,8 @@ new function() {
|
||||||
data = node.getAttribute && node.getAttribute('data-paper-data'),
|
data = node.getAttribute && node.getAttribute('data-paper-data'),
|
||||||
settings = scope.settings,
|
settings = scope.settings,
|
||||||
applyMatrix = settings.applyMatrix;
|
applyMatrix = settings.applyMatrix;
|
||||||
|
if (isRoot)
|
||||||
|
rootSize = scope.getView().getSize();
|
||||||
settings.applyMatrix = false;
|
settings.applyMatrix = false;
|
||||||
item = importer && importer(node, type, options, isRoot) || null;
|
item = importer && importer(node, type, options, isRoot) || null;
|
||||||
settings.applyMatrix = applyMatrix;
|
settings.applyMatrix = applyMatrix;
|
||||||
|
|
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