mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Revert unecessarily commited files in pull request #586
This commit is contained in:
parent
dfda6cf7b5
commit
5b9eb4bd1a
4 changed files with 90 additions and 92 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
build/zip
|
|
||||||
|
|
74
dist/paper-core.js
vendored
74
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Dec 2 22:31:20 2014 -0800
|
* Date: Sat Nov 22 09:01:01 2014 -0800
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -219,8 +219,10 @@ var Base = new function() {
|
||||||
|| ctor.name === 'Object');
|
|| ctor.name === 'Object');
|
||||||
},
|
},
|
||||||
|
|
||||||
pick: function(a, b) {
|
pick: function() {
|
||||||
return a !== undefined ? a : b;
|
for (var i = 0, l = arguments.length; i < l; i++)
|
||||||
|
if (arguments[i] !== undefined)
|
||||||
|
return arguments[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -255,10 +257,6 @@ Base.inject({
|
||||||
}, []).join(', ') + ' }';
|
}, []).join(', ') + ' }';
|
||||||
},
|
},
|
||||||
|
|
||||||
getClassName: function() {
|
|
||||||
return this._class || '';
|
|
||||||
},
|
|
||||||
|
|
||||||
exportJSON: function(options) {
|
exportJSON: function(options) {
|
||||||
return Base.exportJSON(this, options);
|
return Base.exportJSON(this, options);
|
||||||
},
|
},
|
||||||
|
@ -2835,6 +2833,10 @@ var Item = Base.extend(Emitter, {
|
||||||
return this._id;
|
return this._id;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getClassName: function() {
|
||||||
|
return this._class;
|
||||||
|
},
|
||||||
|
|
||||||
getName: function() {
|
getName: function() {
|
||||||
return this._name;
|
return this._name;
|
||||||
},
|
},
|
||||||
|
@ -5359,7 +5361,6 @@ var SegmentPoint = Point.extend({
|
||||||
|
|
||||||
var Curve = Base.extend({
|
var Curve = Base.extend({
|
||||||
_class: 'Curve',
|
_class: 'Curve',
|
||||||
|
|
||||||
initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
||||||
var count = arguments.length;
|
var count = arguments.length;
|
||||||
if (count === 3) {
|
if (count === 3) {
|
||||||
|
@ -10320,30 +10321,31 @@ var View = Base.extend(Emitter, {
|
||||||
userDrag: none,
|
userDrag: none,
|
||||||
tapHighlightColor: 'rgba(0,0,0,0)'
|
tapHighlightColor: 'rgba(0,0,0,0)'
|
||||||
});
|
});
|
||||||
|
if (PaperScope.hasAttribute(element, 'resize')) {
|
||||||
var getCanvasSize = function() {
|
var offset = DomElement.getOffset(element, true),
|
||||||
size = DomElement.getSize(element);
|
that = this;
|
||||||
if (size.isNaN() || size.isZero()) {
|
size = DomElement.getViewportBounds(element)
|
||||||
var getSize = function(name) {
|
.getSize().subtract(offset);
|
||||||
return element[name]
|
this._windowEvents = {
|
||||||
|| parseInt(element.getAttribute(name), 10);
|
resize: function() {
|
||||||
};
|
if (!DomElement.isInvisible(element))
|
||||||
size = new Size(getSize('width'), getSize('height'));
|
offset = DomElement.getOffset(element, true);
|
||||||
|
that.setViewSize(DomElement.getViewportBounds(element)
|
||||||
|
.getSize().subtract(offset));
|
||||||
}
|
}
|
||||||
return size;
|
|
||||||
};
|
};
|
||||||
|
DomEvent.add(window, this._windowEvents);
|
||||||
this._resizable = PaperScope.hasAttribute(element, 'resize');
|
} else {
|
||||||
if (this._resizable) {
|
size = DomElement.getSize(element);
|
||||||
var that = this;
|
if (size.isNaN() || size.isZero()) {
|
||||||
this._windowEvents = {
|
var getSize = function(name) {
|
||||||
resize: function() {
|
return element[name]
|
||||||
that.setViewSize(getCanvasSize());
|
|| parseInt(element.getAttribute(name), 10);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
DomEvent.add(window, this._windowEvents);
|
size = new Size(getSize('width'), getSize('height'));
|
||||||
}
|
}
|
||||||
this._setViewSize(getCanvasSize());
|
}
|
||||||
|
this._setViewSize(size);
|
||||||
if (PaperScope.hasAttribute(element, 'stats')
|
if (PaperScope.hasAttribute(element, 'stats')
|
||||||
&& typeof Stats !== 'undefined') {
|
&& typeof Stats !== 'undefined') {
|
||||||
this._stats = new Stats();
|
this._stats = new Stats();
|
||||||
|
@ -10757,13 +10759,11 @@ var CanvasView = View.extend({
|
||||||
style = element.style;
|
style = element.style;
|
||||||
element.width = width * pixelRatio;
|
element.width = width * pixelRatio;
|
||||||
element.height = height * pixelRatio;
|
element.height = height * pixelRatio;
|
||||||
if (pixelRatio !== 1) {
|
if (pixelRatio !== 1) {
|
||||||
if (this._resizable === false) {
|
style.width = width + 'px';
|
||||||
style.width = width + 'px';
|
style.height = height + 'px';
|
||||||
style.height = height + 'px';
|
this._context.scale(pixelRatio, pixelRatio);
|
||||||
}
|
}
|
||||||
this._context.scale(pixelRatio, pixelRatio);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getPixelSize: function(size) {
|
getPixelSize: function(size) {
|
||||||
|
@ -11735,11 +11735,11 @@ new function() {
|
||||||
scale = decomposed.scaling;
|
scale = decomposed.scaling;
|
||||||
if (trans && !trans.isZero())
|
if (trans && !trans.isZero())
|
||||||
parts.push('translate(' + formatter.point(trans) + ')');
|
parts.push('translate(' + formatter.point(trans) + ')');
|
||||||
|
if (angle)
|
||||||
|
parts.push('rotate(' + formatter.number(angle) + ')');
|
||||||
if (!Numerical.isZero(scale.x - 1)
|
if (!Numerical.isZero(scale.x - 1)
|
||||||
|| !Numerical.isZero(scale.y - 1))
|
|| !Numerical.isZero(scale.y - 1))
|
||||||
parts.push('scale(' + formatter.point(scale) +')');
|
parts.push('scale(' + formatter.point(scale) +')');
|
||||||
if (angle)
|
|
||||||
parts.push('rotate(' + formatter.number(angle) + ')');
|
|
||||||
attrs.transform = parts.join(' ');
|
attrs.transform = parts.join(' ');
|
||||||
} else {
|
} else {
|
||||||
attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')';
|
attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')';
|
||||||
|
|
74
dist/paper-full.js
vendored
74
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Dec 2 22:31:20 2014 -0800
|
* Date: Sat Nov 22 09:01:01 2014 -0800
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -219,8 +219,10 @@ var Base = new function() {
|
||||||
|| ctor.name === 'Object');
|
|| ctor.name === 'Object');
|
||||||
},
|
},
|
||||||
|
|
||||||
pick: function(a, b) {
|
pick: function() {
|
||||||
return a !== undefined ? a : b;
|
for (var i = 0, l = arguments.length; i < l; i++)
|
||||||
|
if (arguments[i] !== undefined)
|
||||||
|
return arguments[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -255,10 +257,6 @@ Base.inject({
|
||||||
}, []).join(', ') + ' }';
|
}, []).join(', ') + ' }';
|
||||||
},
|
},
|
||||||
|
|
||||||
getClassName: function() {
|
|
||||||
return this._class || '';
|
|
||||||
},
|
|
||||||
|
|
||||||
exportJSON: function(options) {
|
exportJSON: function(options) {
|
||||||
return Base.exportJSON(this, options);
|
return Base.exportJSON(this, options);
|
||||||
},
|
},
|
||||||
|
@ -2835,6 +2833,10 @@ var Item = Base.extend(Emitter, {
|
||||||
return this._id;
|
return this._id;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getClassName: function() {
|
||||||
|
return this._class;
|
||||||
|
},
|
||||||
|
|
||||||
getName: function() {
|
getName: function() {
|
||||||
return this._name;
|
return this._name;
|
||||||
},
|
},
|
||||||
|
@ -5359,7 +5361,6 @@ var SegmentPoint = Point.extend({
|
||||||
|
|
||||||
var Curve = Base.extend({
|
var Curve = Base.extend({
|
||||||
_class: 'Curve',
|
_class: 'Curve',
|
||||||
|
|
||||||
initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
||||||
var count = arguments.length;
|
var count = arguments.length;
|
||||||
if (count === 3) {
|
if (count === 3) {
|
||||||
|
@ -10320,30 +10321,31 @@ var View = Base.extend(Emitter, {
|
||||||
userDrag: none,
|
userDrag: none,
|
||||||
tapHighlightColor: 'rgba(0,0,0,0)'
|
tapHighlightColor: 'rgba(0,0,0,0)'
|
||||||
});
|
});
|
||||||
|
if (PaperScope.hasAttribute(element, 'resize')) {
|
||||||
var getCanvasSize = function() {
|
var offset = DomElement.getOffset(element, true),
|
||||||
size = DomElement.getSize(element);
|
that = this;
|
||||||
if (size.isNaN() || size.isZero()) {
|
size = DomElement.getViewportBounds(element)
|
||||||
var getSize = function(name) {
|
.getSize().subtract(offset);
|
||||||
return element[name]
|
this._windowEvents = {
|
||||||
|| parseInt(element.getAttribute(name), 10);
|
resize: function() {
|
||||||
};
|
if (!DomElement.isInvisible(element))
|
||||||
size = new Size(getSize('width'), getSize('height'));
|
offset = DomElement.getOffset(element, true);
|
||||||
|
that.setViewSize(DomElement.getViewportBounds(element)
|
||||||
|
.getSize().subtract(offset));
|
||||||
}
|
}
|
||||||
return size;
|
|
||||||
};
|
};
|
||||||
|
DomEvent.add(window, this._windowEvents);
|
||||||
this._resizable = PaperScope.hasAttribute(element, 'resize');
|
} else {
|
||||||
if (this._resizable) {
|
size = DomElement.getSize(element);
|
||||||
var that = this;
|
if (size.isNaN() || size.isZero()) {
|
||||||
this._windowEvents = {
|
var getSize = function(name) {
|
||||||
resize: function() {
|
return element[name]
|
||||||
that.setViewSize(getCanvasSize());
|
|| parseInt(element.getAttribute(name), 10);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
DomEvent.add(window, this._windowEvents);
|
size = new Size(getSize('width'), getSize('height'));
|
||||||
}
|
}
|
||||||
this._setViewSize(getCanvasSize());
|
}
|
||||||
|
this._setViewSize(size);
|
||||||
if (PaperScope.hasAttribute(element, 'stats')
|
if (PaperScope.hasAttribute(element, 'stats')
|
||||||
&& typeof Stats !== 'undefined') {
|
&& typeof Stats !== 'undefined') {
|
||||||
this._stats = new Stats();
|
this._stats = new Stats();
|
||||||
|
@ -10757,13 +10759,11 @@ var CanvasView = View.extend({
|
||||||
style = element.style;
|
style = element.style;
|
||||||
element.width = width * pixelRatio;
|
element.width = width * pixelRatio;
|
||||||
element.height = height * pixelRatio;
|
element.height = height * pixelRatio;
|
||||||
if (pixelRatio !== 1) {
|
if (pixelRatio !== 1) {
|
||||||
if (this._resizable === false) {
|
style.width = width + 'px';
|
||||||
style.width = width + 'px';
|
style.height = height + 'px';
|
||||||
style.height = height + 'px';
|
this._context.scale(pixelRatio, pixelRatio);
|
||||||
}
|
}
|
||||||
this._context.scale(pixelRatio, pixelRatio);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getPixelSize: function(size) {
|
getPixelSize: function(size) {
|
||||||
|
@ -11735,11 +11735,11 @@ new function() {
|
||||||
scale = decomposed.scaling;
|
scale = decomposed.scaling;
|
||||||
if (trans && !trans.isZero())
|
if (trans && !trans.isZero())
|
||||||
parts.push('translate(' + formatter.point(trans) + ')');
|
parts.push('translate(' + formatter.point(trans) + ')');
|
||||||
|
if (angle)
|
||||||
|
parts.push('rotate(' + formatter.number(angle) + ')');
|
||||||
if (!Numerical.isZero(scale.x - 1)
|
if (!Numerical.isZero(scale.x - 1)
|
||||||
|| !Numerical.isZero(scale.y - 1))
|
|| !Numerical.isZero(scale.y - 1))
|
||||||
parts.push('scale(' + formatter.point(scale) +')');
|
parts.push('scale(' + formatter.point(scale) +')');
|
||||||
if (angle)
|
|
||||||
parts.push('rotate(' + formatter.number(angle) + ')');
|
|
||||||
attrs.transform = parts.join(' ');
|
attrs.transform = parts.join(' ');
|
||||||
} else {
|
} else {
|
||||||
attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')';
|
attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')';
|
||||||
|
|
33
dist/paper-node.js
vendored
33
dist/paper-node.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Dec 2 22:31:20 2014 -0800
|
* Date: Sat Nov 22 09:01:01 2014 -0800
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -219,8 +219,10 @@ var Base = new function() {
|
||||||
|| ctor.name === 'Object');
|
|| ctor.name === 'Object');
|
||||||
},
|
},
|
||||||
|
|
||||||
pick: function(a, b) {
|
pick: function() {
|
||||||
return a !== undefined ? a : b;
|
for (var i = 0, l = arguments.length; i < l; i++)
|
||||||
|
if (arguments[i] !== undefined)
|
||||||
|
return arguments[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -245,10 +247,6 @@ Base.inject({
|
||||||
}, []).join(', ') + ' }';
|
}, []).join(', ') + ' }';
|
||||||
},
|
},
|
||||||
|
|
||||||
getClassName: function() {
|
|
||||||
return this._class || '';
|
|
||||||
},
|
|
||||||
|
|
||||||
exportJSON: function(options) {
|
exportJSON: function(options) {
|
||||||
return Base.exportJSON(this, options);
|
return Base.exportJSON(this, options);
|
||||||
},
|
},
|
||||||
|
@ -2804,6 +2802,10 @@ var Item = Base.extend(Emitter, {
|
||||||
return this._id;
|
return this._id;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getClassName: function() {
|
||||||
|
return this._class;
|
||||||
|
},
|
||||||
|
|
||||||
getName: function() {
|
getName: function() {
|
||||||
return this._name;
|
return this._name;
|
||||||
},
|
},
|
||||||
|
@ -5343,7 +5345,6 @@ var SegmentPoint = Point.extend({
|
||||||
|
|
||||||
var Curve = Base.extend({
|
var Curve = Base.extend({
|
||||||
_class: 'Curve',
|
_class: 'Curve',
|
||||||
|
|
||||||
initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
||||||
var count = arguments.length;
|
var count = arguments.length;
|
||||||
if (count === 3) {
|
if (count === 3) {
|
||||||
|
@ -10479,13 +10480,11 @@ var CanvasView = View.extend({
|
||||||
style = element.style;
|
style = element.style;
|
||||||
element.width = width * pixelRatio;
|
element.width = width * pixelRatio;
|
||||||
element.height = height * pixelRatio;
|
element.height = height * pixelRatio;
|
||||||
if (pixelRatio !== 1) {
|
if (pixelRatio !== 1) {
|
||||||
if (this._resizable === false) {
|
style.width = width + 'px';
|
||||||
style.width = width + 'px';
|
style.height = height + 'px';
|
||||||
style.height = height + 'px';
|
this._context.scale(pixelRatio, pixelRatio);
|
||||||
}
|
}
|
||||||
this._context.scale(pixelRatio, pixelRatio);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getPixelSize: function(size) {
|
getPixelSize: function(size) {
|
||||||
|
@ -11076,11 +11075,11 @@ new function() {
|
||||||
scale = decomposed.scaling;
|
scale = decomposed.scaling;
|
||||||
if (trans && !trans.isZero())
|
if (trans && !trans.isZero())
|
||||||
parts.push('translate(' + formatter.point(trans) + ')');
|
parts.push('translate(' + formatter.point(trans) + ')');
|
||||||
|
if (angle)
|
||||||
|
parts.push('rotate(' + formatter.number(angle) + ')');
|
||||||
if (!Numerical.isZero(scale.x - 1)
|
if (!Numerical.isZero(scale.x - 1)
|
||||||
|| !Numerical.isZero(scale.y - 1))
|
|| !Numerical.isZero(scale.y - 1))
|
||||||
parts.push('scale(' + formatter.point(scale) +')');
|
parts.push('scale(' + formatter.point(scale) +')');
|
||||||
if (angle)
|
|
||||||
parts.push('rotate(' + formatter.number(angle) + ')');
|
|
||||||
attrs.transform = parts.join(' ');
|
attrs.transform = parts.join(' ');
|
||||||
} else {
|
} else {
|
||||||
attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')';
|
attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')';
|
||||||
|
|
Loading…
Reference in a new issue