Remove notify parameter again from _add().

This commit is contained in:
Jürg Lehni 2011-05-06 00:18:56 +01:00
parent 20cf32d599
commit a3da96e8be

View file

@ -52,7 +52,7 @@ var Path = this.Path = PathItem.extend({
if (this._curves) if (this._curves)
this._curves = null; this._curves = null;
} }
this._add(Segment.readAll(segments), true); this._add(Segment.readAll(segments));
}, },
getFirstSegment: function() { getFirstSegment: function() {
@ -136,7 +136,7 @@ var Path = this.Path = PathItem.extend({
* If a curves list was requested, it will kept in sync with the segments * If a curves list was requested, it will kept in sync with the segments
* list automatically. * list automatically.
*/ */
_add: function(segs, notify, index) { _add: function(segs, index) {
// Local short-cuts: // Local short-cuts:
var segments = this._segments, var segments = this._segments,
curves = this._curves, curves = this._curves,
@ -175,8 +175,7 @@ var Path = this.Path = PathItem.extend({
if (curve) if (curve)
curve._segment1 = segments[index + amount]; curve._segment1 = segments[index + amount];
} }
if (notify) this._changed();
this._changed();
return segs; return segs;
}, },
@ -184,38 +183,38 @@ var Path = this.Path = PathItem.extend({
add: function(segment1 /*, segment2, ... */) { add: function(segment1 /*, segment2, ... */) {
return arguments.length > 1 && typeof segment1 != 'number' return arguments.length > 1 && typeof segment1 != 'number'
// addSegments // addSegments
? this._add(Segment.readAll(arguments), true) ? this._add(Segment.readAll(arguments))
// addSegment // addSegment
: this._add([ Segment.read(arguments) ], true)[0]; : this._add([ Segment.read(arguments) ])[0];
}, },
// TODO: Port back support for adding multiple segments at once to Sg // TODO: Port back support for adding multiple segments at once to Sg
insert: function(index, segment1 /*, segment2, ... */) { insert: function(index, segment1 /*, segment2, ... */) {
return arguments.length > 2 && typeof segment1 != 'number' return arguments.length > 2 && typeof segment1 != 'number'
// insertSegments // insertSegments
? this._add(Segment.readAll(arguments, 1), true, index) ? this._add(Segment.readAll(arguments, 1), index)
// insertSegment // insertSegment
: this._add([ Segment.read(arguments, 1) ], true, index)[0]; : this._add([ Segment.read(arguments, 1) ], index)[0];
}, },
// TODO: Port back to Sg // TODO: Port back to Sg
addSegment: function(segment) { addSegment: function(segment) {
return this._add([ Segment.read(arguments) ], true)[0]; return this._add([ Segment.read(arguments) ])[0];
}, },
// TODO: Port back to Sg // TODO: Port back to Sg
insertSegment: function(index, segment) { insertSegment: function(index, segment) {
return this._add([ Segment.read(arguments, 1) ], true, index)[0]; return this._add([ Segment.read(arguments, 1) ], index)[0];
}, },
// TODO: Port back to Sg // TODO: Port back to Sg
addSegments: function(segments) { addSegments: function(segments) {
return this._add(Segment.readAll(segments), true); return this._add(Segment.readAll(segments));
}, },
// TODO: Port back to Sg // TODO: Port back to Sg
insertSegments: function(index, segments) { insertSegments: function(index, segments) {
return this._add(Segment.readAll(segments), true, index); return this._add(Segment.readAll(segments), index);
}, },
// TODO: Port back to Sg // TODO: Port back to Sg
@ -708,12 +707,12 @@ var Path = this.Path = PathItem.extend({
// Let's not be picky about calling moveTo() when not at the // Let's not be picky about calling moveTo() when not at the
// beginning of a path, just bail out: // beginning of a path, just bail out:
if (!this._segments.length) if (!this._segments.length)
this._add([ new Segment(Point.read(arguments)) ], true); this._add([ new Segment(Point.read(arguments)) ]);
}, },
lineTo: function() { lineTo: function() {
// Let's not be picky about calling moveTo() first: // Let's not be picky about calling moveTo() first:
this._add([ new Segment(Point.read(arguments)) ], true); this._add([ new Segment(Point.read(arguments)) ]);
}, },
/** /**
@ -729,7 +728,7 @@ var Path = this.Path = PathItem.extend({
// Convert to relative values: // Convert to relative values:
current.setHandleOut(handle1.subtract(current._point)); current.setHandleOut(handle1.subtract(current._point));
// And add the new segment, with handleIn set to c2 // And add the new segment, with handleIn set to c2
this._add([ new Segment(to, handle2.subtract(to)) ], true); this._add([ new Segment(to, handle2.subtract(to)) ]);
}, },
/** /**
@ -864,7 +863,7 @@ var Path = this.Path = PathItem.extend({
angle += inc; angle += inc;
} }
// Add all segments at once at the end for higher performance // Add all segments at once at the end for higher performance
this._add(segments, true); this._add(segments);
}, },
lineBy: function(vector) { lineBy: function(vector) {