mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Clean up code.
This commit is contained in:
parent
bc567f4d29
commit
22736dc72d
1 changed files with 7 additions and 7 deletions
|
@ -42,15 +42,15 @@ var Item = this.Item = Base.extend({
|
|||
* @param {ChangeFlag} flags describes what exactly has changed.
|
||||
*/
|
||||
_changed: function(flags) {
|
||||
if (flags & ChangeFlag.APPEARANCE) {
|
||||
if (this._project)
|
||||
this._project._needsRedraw();
|
||||
}
|
||||
if (flags & ChangeFlag.GEOMETRY) {
|
||||
// Clear cached bounds and position whenever geometry changes
|
||||
delete this._bounds;
|
||||
delete this._position;
|
||||
}
|
||||
if (flags & ChangeFlag.APPEARANCE) {
|
||||
if (this._project)
|
||||
this._project._needsRedraw();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1064,11 +1064,11 @@ var Item = this.Item = Base.extend({
|
|||
// Scriptographer behaves weirdly then too.
|
||||
if (!children || children.length == 0)
|
||||
return new Rectangle();
|
||||
var x1 = Infinity,
|
||||
var getBounds = includeStroke ? 'getStrokeBounds' : 'getBounds',
|
||||
x1 = Infinity,
|
||||
x2 = -Infinity,
|
||||
y1 = x1,
|
||||
y2 = x2,
|
||||
getBounds = includeStroke ? 'getStrokeBounds' : 'getBounds';
|
||||
y2 = x2;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
var child = children[i];
|
||||
if (child._visible) {
|
||||
|
|
Loading…
Reference in a new issue