mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 22:01:58 -05:00
Prebuilt module for commit 6f4890c63c
This commit is contained in:
parent
f4a5c21003
commit
ee01360545
5 changed files with 187 additions and 136 deletions
93
dist/docs/assets/js/paper.js
vendored
93
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Sun Feb 14 23:22:39 2016 +0100
|
* Date: Mon Feb 15 00:13:38 2016 +0100
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -3143,31 +3143,6 @@ new function() {
|
||||||
: bounds;
|
: bounds;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getBounds: function(matrix, options) {
|
|
||||||
var children = this._children;
|
|
||||||
if (!children || children.length === 0)
|
|
||||||
return new Rectangle();
|
|
||||||
Item._updateBoundsCache(this, options.cacheItem);
|
|
||||||
var x1 = Infinity,
|
|
||||||
x2 = -x1,
|
|
||||||
y1 = x1,
|
|
||||||
y2 = x2;
|
|
||||||
for (var i = 0, l = children.length; i < l; i++) {
|
|
||||||
var child = children[i];
|
|
||||||
if (child._visible && !child.isEmpty()) {
|
|
||||||
var rect = child._getCachedBounds(
|
|
||||||
matrix && matrix.appended(child._matrix), options);
|
|
||||||
x1 = Math.min(rect.x, x1);
|
|
||||||
y1 = Math.min(rect.y, y1);
|
|
||||||
x2 = Math.max(rect.x + rect.width, x2);
|
|
||||||
y2 = Math.max(rect.y + rect.height, y2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isFinite(x1)
|
|
||||||
? new Rectangle(x1, y1, x2 - x1, y2 - y1)
|
|
||||||
: new Rectangle();
|
|
||||||
},
|
|
||||||
|
|
||||||
setBounds: function() {
|
setBounds: function() {
|
||||||
var rect = Rectangle.read(arguments),
|
var rect = Rectangle.read(arguments),
|
||||||
bounds = this.getBounds(),
|
bounds = this.getBounds(),
|
||||||
|
@ -3190,6 +3165,14 @@ new function() {
|
||||||
this.transform(matrix);
|
this.transform(matrix);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getBounds: function(matrix, options) {
|
||||||
|
var children = this._children;
|
||||||
|
if (!children || children.length === 0)
|
||||||
|
return new Rectangle();
|
||||||
|
Item._updateBoundsCache(this, options.cacheItem);
|
||||||
|
return Item._getBounds(children, matrix, options);
|
||||||
|
},
|
||||||
|
|
||||||
_getCachedBounds: function(matrix, options) {
|
_getCachedBounds: function(matrix, options) {
|
||||||
matrix = matrix && matrix._orNullIfIdentity();
|
matrix = matrix && matrix._orNullIfIdentity();
|
||||||
var internal = options.internal,
|
var internal = options.internal,
|
||||||
|
@ -3248,6 +3231,28 @@ new function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_getBounds: function(items, matrix, options) {
|
||||||
|
var x1 = Infinity,
|
||||||
|
x2 = -x1,
|
||||||
|
y1 = x1,
|
||||||
|
y2 = x2;
|
||||||
|
options = options || {};
|
||||||
|
for (var i = 0, l = items.length; i < l; i++) {
|
||||||
|
var item = items[i];
|
||||||
|
if (item._visible && !item.isEmpty()) {
|
||||||
|
var rect = item._getCachedBounds(
|
||||||
|
matrix && matrix.appended(item._matrix), options);
|
||||||
|
x1 = Math.min(rect.x, x1);
|
||||||
|
y1 = Math.min(rect.y, y1);
|
||||||
|
x2 = Math.max(rect.x + rect.width, x2);
|
||||||
|
y2 = Math.max(rect.y + rect.height, y2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isFinite(x1)
|
||||||
|
? new Rectangle(x1, y1, x2 - x1, y2 - y1)
|
||||||
|
: new Rectangle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13442,23 +13447,35 @@ new function() {
|
||||||
options = setOptions(options);
|
options = setOptions(options);
|
||||||
var children = this._children,
|
var children = this._children,
|
||||||
view = this.getView(),
|
view = this.getView(),
|
||||||
size = view.getViewSize(),
|
bounds = Base.pick(options.bounds, 'view'),
|
||||||
node = SvgElement.create('svg', {
|
matrix = Matrix.read(
|
||||||
x: 0,
|
[options.matrix || bounds === 'view' && view._matrix],
|
||||||
y: 0,
|
0, { readNull: true }),
|
||||||
width: size.width,
|
rect = bounds === 'view'
|
||||||
height: size.height,
|
? new Rectangle([0, 0], view.getViewSize())
|
||||||
|
: bounds === 'content'
|
||||||
|
? Item._getBounds(children, matrix, { stroke: true })
|
||||||
|
: Rectangle.read([bounds], 0, { readNull: true });
|
||||||
|
attrs = {
|
||||||
version: '1.1',
|
version: '1.1',
|
||||||
xmlns: SvgElement.svg,
|
xmlns: SvgElement.svg,
|
||||||
'xmlns:xlink': SvgElement.xlink
|
'xmlns:xlink': SvgElement.xlink,
|
||||||
}, formatter),
|
};
|
||||||
parent = node,
|
if (rect) {
|
||||||
matrix = view._matrix;
|
attrs.width = rect.width;
|
||||||
if (!matrix.isIdentity())
|
attrs.height = rect.height;
|
||||||
|
if (rect.x || rect.y)
|
||||||
|
attrs.viewBox = formatter.rectangle(rect);
|
||||||
|
}
|
||||||
|
var node = SvgElement.create('svg', attrs, formatter),
|
||||||
|
parent = node;
|
||||||
|
if (matrix && !matrix.isIdentity()) {
|
||||||
parent = node.appendChild(SvgElement.create('g',
|
parent = node.appendChild(SvgElement.create('g',
|
||||||
getTransform(matrix), formatter));
|
getTransform(matrix), formatter));
|
||||||
for (var i = 0, l = children.length; i < l; i++)
|
}
|
||||||
|
for (var i = 0, l = children.length; i < l; i++) {
|
||||||
parent.appendChild(exportSVG(children[i], options, true));
|
parent.appendChild(exportSVG(children[i], options, true));
|
||||||
|
}
|
||||||
return exportDefinitions(node, options);
|
return exportDefinitions(node, options);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
93
dist/paper-core.js
vendored
93
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Sun Feb 14 23:22:39 2016 +0100
|
* Date: Mon Feb 15 00:13:38 2016 +0100
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -3143,31 +3143,6 @@ new function() {
|
||||||
: bounds;
|
: bounds;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getBounds: function(matrix, options) {
|
|
||||||
var children = this._children;
|
|
||||||
if (!children || children.length === 0)
|
|
||||||
return new Rectangle();
|
|
||||||
Item._updateBoundsCache(this, options.cacheItem);
|
|
||||||
var x1 = Infinity,
|
|
||||||
x2 = -x1,
|
|
||||||
y1 = x1,
|
|
||||||
y2 = x2;
|
|
||||||
for (var i = 0, l = children.length; i < l; i++) {
|
|
||||||
var child = children[i];
|
|
||||||
if (child._visible && !child.isEmpty()) {
|
|
||||||
var rect = child._getCachedBounds(
|
|
||||||
matrix && matrix.appended(child._matrix), options);
|
|
||||||
x1 = Math.min(rect.x, x1);
|
|
||||||
y1 = Math.min(rect.y, y1);
|
|
||||||
x2 = Math.max(rect.x + rect.width, x2);
|
|
||||||
y2 = Math.max(rect.y + rect.height, y2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isFinite(x1)
|
|
||||||
? new Rectangle(x1, y1, x2 - x1, y2 - y1)
|
|
||||||
: new Rectangle();
|
|
||||||
},
|
|
||||||
|
|
||||||
setBounds: function() {
|
setBounds: function() {
|
||||||
var rect = Rectangle.read(arguments),
|
var rect = Rectangle.read(arguments),
|
||||||
bounds = this.getBounds(),
|
bounds = this.getBounds(),
|
||||||
|
@ -3190,6 +3165,14 @@ new function() {
|
||||||
this.transform(matrix);
|
this.transform(matrix);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getBounds: function(matrix, options) {
|
||||||
|
var children = this._children;
|
||||||
|
if (!children || children.length === 0)
|
||||||
|
return new Rectangle();
|
||||||
|
Item._updateBoundsCache(this, options.cacheItem);
|
||||||
|
return Item._getBounds(children, matrix, options);
|
||||||
|
},
|
||||||
|
|
||||||
_getCachedBounds: function(matrix, options) {
|
_getCachedBounds: function(matrix, options) {
|
||||||
matrix = matrix && matrix._orNullIfIdentity();
|
matrix = matrix && matrix._orNullIfIdentity();
|
||||||
var internal = options.internal,
|
var internal = options.internal,
|
||||||
|
@ -3248,6 +3231,28 @@ new function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_getBounds: function(items, matrix, options) {
|
||||||
|
var x1 = Infinity,
|
||||||
|
x2 = -x1,
|
||||||
|
y1 = x1,
|
||||||
|
y2 = x2;
|
||||||
|
options = options || {};
|
||||||
|
for (var i = 0, l = items.length; i < l; i++) {
|
||||||
|
var item = items[i];
|
||||||
|
if (item._visible && !item.isEmpty()) {
|
||||||
|
var rect = item._getCachedBounds(
|
||||||
|
matrix && matrix.appended(item._matrix), options);
|
||||||
|
x1 = Math.min(rect.x, x1);
|
||||||
|
y1 = Math.min(rect.y, y1);
|
||||||
|
x2 = Math.max(rect.x + rect.width, x2);
|
||||||
|
y2 = Math.max(rect.y + rect.height, y2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isFinite(x1)
|
||||||
|
? new Rectangle(x1, y1, x2 - x1, y2 - y1)
|
||||||
|
: new Rectangle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13442,23 +13447,35 @@ new function() {
|
||||||
options = setOptions(options);
|
options = setOptions(options);
|
||||||
var children = this._children,
|
var children = this._children,
|
||||||
view = this.getView(),
|
view = this.getView(),
|
||||||
size = view.getViewSize(),
|
bounds = Base.pick(options.bounds, 'view'),
|
||||||
node = SvgElement.create('svg', {
|
matrix = Matrix.read(
|
||||||
x: 0,
|
[options.matrix || bounds === 'view' && view._matrix],
|
||||||
y: 0,
|
0, { readNull: true }),
|
||||||
width: size.width,
|
rect = bounds === 'view'
|
||||||
height: size.height,
|
? new Rectangle([0, 0], view.getViewSize())
|
||||||
|
: bounds === 'content'
|
||||||
|
? Item._getBounds(children, matrix, { stroke: true })
|
||||||
|
: Rectangle.read([bounds], 0, { readNull: true });
|
||||||
|
attrs = {
|
||||||
version: '1.1',
|
version: '1.1',
|
||||||
xmlns: SvgElement.svg,
|
xmlns: SvgElement.svg,
|
||||||
'xmlns:xlink': SvgElement.xlink
|
'xmlns:xlink': SvgElement.xlink,
|
||||||
}, formatter),
|
};
|
||||||
parent = node,
|
if (rect) {
|
||||||
matrix = view._matrix;
|
attrs.width = rect.width;
|
||||||
if (!matrix.isIdentity())
|
attrs.height = rect.height;
|
||||||
|
if (rect.x || rect.y)
|
||||||
|
attrs.viewBox = formatter.rectangle(rect);
|
||||||
|
}
|
||||||
|
var node = SvgElement.create('svg', attrs, formatter),
|
||||||
|
parent = node;
|
||||||
|
if (matrix && !matrix.isIdentity()) {
|
||||||
parent = node.appendChild(SvgElement.create('g',
|
parent = node.appendChild(SvgElement.create('g',
|
||||||
getTransform(matrix), formatter));
|
getTransform(matrix), formatter));
|
||||||
for (var i = 0, l = children.length; i < l; i++)
|
}
|
||||||
|
for (var i = 0, l = children.length; i < l; i++) {
|
||||||
parent.appendChild(exportSVG(children[i], options, true));
|
parent.appendChild(exportSVG(children[i], options, true));
|
||||||
|
}
|
||||||
return exportDefinitions(node, options);
|
return exportDefinitions(node, options);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
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
93
dist/paper-full.js
vendored
93
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Sun Feb 14 23:22:39 2016 +0100
|
* Date: Mon Feb 15 00:13:38 2016 +0100
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -3143,31 +3143,6 @@ new function() {
|
||||||
: bounds;
|
: bounds;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getBounds: function(matrix, options) {
|
|
||||||
var children = this._children;
|
|
||||||
if (!children || children.length === 0)
|
|
||||||
return new Rectangle();
|
|
||||||
Item._updateBoundsCache(this, options.cacheItem);
|
|
||||||
var x1 = Infinity,
|
|
||||||
x2 = -x1,
|
|
||||||
y1 = x1,
|
|
||||||
y2 = x2;
|
|
||||||
for (var i = 0, l = children.length; i < l; i++) {
|
|
||||||
var child = children[i];
|
|
||||||
if (child._visible && !child.isEmpty()) {
|
|
||||||
var rect = child._getCachedBounds(
|
|
||||||
matrix && matrix.appended(child._matrix), options);
|
|
||||||
x1 = Math.min(rect.x, x1);
|
|
||||||
y1 = Math.min(rect.y, y1);
|
|
||||||
x2 = Math.max(rect.x + rect.width, x2);
|
|
||||||
y2 = Math.max(rect.y + rect.height, y2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isFinite(x1)
|
|
||||||
? new Rectangle(x1, y1, x2 - x1, y2 - y1)
|
|
||||||
: new Rectangle();
|
|
||||||
},
|
|
||||||
|
|
||||||
setBounds: function() {
|
setBounds: function() {
|
||||||
var rect = Rectangle.read(arguments),
|
var rect = Rectangle.read(arguments),
|
||||||
bounds = this.getBounds(),
|
bounds = this.getBounds(),
|
||||||
|
@ -3190,6 +3165,14 @@ new function() {
|
||||||
this.transform(matrix);
|
this.transform(matrix);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getBounds: function(matrix, options) {
|
||||||
|
var children = this._children;
|
||||||
|
if (!children || children.length === 0)
|
||||||
|
return new Rectangle();
|
||||||
|
Item._updateBoundsCache(this, options.cacheItem);
|
||||||
|
return Item._getBounds(children, matrix, options);
|
||||||
|
},
|
||||||
|
|
||||||
_getCachedBounds: function(matrix, options) {
|
_getCachedBounds: function(matrix, options) {
|
||||||
matrix = matrix && matrix._orNullIfIdentity();
|
matrix = matrix && matrix._orNullIfIdentity();
|
||||||
var internal = options.internal,
|
var internal = options.internal,
|
||||||
|
@ -3248,6 +3231,28 @@ new function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_getBounds: function(items, matrix, options) {
|
||||||
|
var x1 = Infinity,
|
||||||
|
x2 = -x1,
|
||||||
|
y1 = x1,
|
||||||
|
y2 = x2;
|
||||||
|
options = options || {};
|
||||||
|
for (var i = 0, l = items.length; i < l; i++) {
|
||||||
|
var item = items[i];
|
||||||
|
if (item._visible && !item.isEmpty()) {
|
||||||
|
var rect = item._getCachedBounds(
|
||||||
|
matrix && matrix.appended(item._matrix), options);
|
||||||
|
x1 = Math.min(rect.x, x1);
|
||||||
|
y1 = Math.min(rect.y, y1);
|
||||||
|
x2 = Math.max(rect.x + rect.width, x2);
|
||||||
|
y2 = Math.max(rect.y + rect.height, y2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isFinite(x1)
|
||||||
|
? new Rectangle(x1, y1, x2 - x1, y2 - y1)
|
||||||
|
: new Rectangle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13442,23 +13447,35 @@ new function() {
|
||||||
options = setOptions(options);
|
options = setOptions(options);
|
||||||
var children = this._children,
|
var children = this._children,
|
||||||
view = this.getView(),
|
view = this.getView(),
|
||||||
size = view.getViewSize(),
|
bounds = Base.pick(options.bounds, 'view'),
|
||||||
node = SvgElement.create('svg', {
|
matrix = Matrix.read(
|
||||||
x: 0,
|
[options.matrix || bounds === 'view' && view._matrix],
|
||||||
y: 0,
|
0, { readNull: true }),
|
||||||
width: size.width,
|
rect = bounds === 'view'
|
||||||
height: size.height,
|
? new Rectangle([0, 0], view.getViewSize())
|
||||||
|
: bounds === 'content'
|
||||||
|
? Item._getBounds(children, matrix, { stroke: true })
|
||||||
|
: Rectangle.read([bounds], 0, { readNull: true });
|
||||||
|
attrs = {
|
||||||
version: '1.1',
|
version: '1.1',
|
||||||
xmlns: SvgElement.svg,
|
xmlns: SvgElement.svg,
|
||||||
'xmlns:xlink': SvgElement.xlink
|
'xmlns:xlink': SvgElement.xlink,
|
||||||
}, formatter),
|
};
|
||||||
parent = node,
|
if (rect) {
|
||||||
matrix = view._matrix;
|
attrs.width = rect.width;
|
||||||
if (!matrix.isIdentity())
|
attrs.height = rect.height;
|
||||||
|
if (rect.x || rect.y)
|
||||||
|
attrs.viewBox = formatter.rectangle(rect);
|
||||||
|
}
|
||||||
|
var node = SvgElement.create('svg', attrs, formatter),
|
||||||
|
parent = node;
|
||||||
|
if (matrix && !matrix.isIdentity()) {
|
||||||
parent = node.appendChild(SvgElement.create('g',
|
parent = node.appendChild(SvgElement.create('g',
|
||||||
getTransform(matrix), formatter));
|
getTransform(matrix), formatter));
|
||||||
for (var i = 0, l = children.length; i < l; i++)
|
}
|
||||||
|
for (var i = 0, l = children.length; i < l; i++) {
|
||||||
parent.appendChild(exportSVG(children[i], options, true));
|
parent.appendChild(exportSVG(children[i], options, true));
|
||||||
|
}
|
||||||
return exportDefinitions(node, options);
|
return exportDefinitions(node, options);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
14
dist/paper-full.min.js
vendored
14
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue