mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Merge branch 'refs/heads/master' into apply-matrix
This commit is contained in:
commit
6fdb9f60bd
3 changed files with 10 additions and 6 deletions
|
@ -2026,7 +2026,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
|||
/**
|
||||
* Inserts this item below the specified item.
|
||||
*
|
||||
* @param {Item} item the item above which it should be inserted
|
||||
* @param {Item} item the item below which it should be inserted
|
||||
* @return {Item} the inserted item, or {@code null} if inserting was not
|
||||
* possible.
|
||||
*/
|
||||
|
|
|
@ -116,11 +116,14 @@ new function() {
|
|||
}
|
||||
|
||||
function importPoly(node, type) {
|
||||
var path = new Path(),
|
||||
points = node.points;
|
||||
path.moveTo(points.getItem(0));
|
||||
for (var i = 1, l = points.numberOfItems; i < l; i++)
|
||||
path.lineTo(points.getItem(i));
|
||||
var coords = node.getAttribute('points').match(
|
||||
/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),
|
||||
points = [];
|
||||
for (var i = 0, l = coords.length; i < l; i += 2)
|
||||
points.push(new Point(
|
||||
parseFloat(coords[i]),
|
||||
parseFloat(coords[i + 1])));
|
||||
var path = new Path(points);
|
||||
if (type === 'polygon')
|
||||
path.closePath();
|
||||
return path;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
var TextItem = Item.extend(/** @lends TextItem# */{
|
||||
_class: 'TextItem',
|
||||
_boundsSelected: true,
|
||||
_transformContent: false,
|
||||
_serializeFields: {
|
||||
content: null
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue