mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Remove all PORT comments, since we won't port back features to Scriptographer.
This commit is contained in:
parent
b54bdadaff
commit
8f093f6dd7
8 changed files with 2 additions and 27 deletions
|
@ -133,7 +133,6 @@ var GradientColor = this.GradientColor = Color.extend(/** @lends GradientColor#
|
||||||
},
|
},
|
||||||
|
|
||||||
setOrigin: function(origin) {
|
setOrigin: function(origin) {
|
||||||
// PORT: Add origin cloning to Scriptographer
|
|
||||||
origin = Point.read(arguments, 0, 0, true); // clone
|
origin = Point.read(arguments, 0, 0, true); // clone
|
||||||
this._origin = origin;
|
this._origin = origin;
|
||||||
if (this._destination)
|
if (this._destination)
|
||||||
|
@ -174,7 +173,6 @@ var GradientColor = this.GradientColor = Color.extend(/** @lends GradientColor#
|
||||||
},
|
},
|
||||||
|
|
||||||
setDestination: function(destination) {
|
setDestination: function(destination) {
|
||||||
// PORT: Add destination cloning to Scriptographer
|
|
||||||
destination = Point.read(arguments, 0, 0, true); // clone
|
destination = Point.read(arguments, 0, 0, true); // clone
|
||||||
this._destination = destination;
|
this._destination = destination;
|
||||||
this._radius = this._destination.getDistance(this._origin);
|
this._radius = this._destination.getDistance(this._origin);
|
||||||
|
@ -213,7 +211,6 @@ var GradientColor = this.GradientColor = Color.extend(/** @lends GradientColor#
|
||||||
},
|
},
|
||||||
|
|
||||||
setHilite: function(hilite) {
|
setHilite: function(hilite) {
|
||||||
// PORT: Add hilite cloning to Scriptographer
|
|
||||||
hilite = Point.read(arguments, 0, 0, true); // clone
|
hilite = Point.read(arguments, 0, 0, true); // clone
|
||||||
var vector = hilite.subtract(this._origin);
|
var vector = hilite.subtract(this._origin);
|
||||||
if (vector.getLength() > this._radius) {
|
if (vector.getLength() > this._radius) {
|
||||||
|
|
|
@ -76,7 +76,6 @@ var Callback = {
|
||||||
Base.each(handlers, function(func) {
|
Base.each(handlers, function(func) {
|
||||||
// When the handler function returns false, prevent the default
|
// When the handler function returns false, prevent the default
|
||||||
// behaviour of the event by calling stop() on it
|
// behaviour of the event by calling stop() on it
|
||||||
// PORT: Add to Sg
|
|
||||||
if (func.apply(this, args) === false && event && event.stop)
|
if (func.apply(this, args) === false && event && event.stop)
|
||||||
event.stop();
|
event.stop();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
|
@ -1868,8 +1868,6 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
// storing the actual location / transformation state.
|
// storing the actual location / transformation state.
|
||||||
if ((this.applyMatrix || arguments[1])
|
if ((this.applyMatrix || arguments[1])
|
||||||
&& this._applyMatrix(this._matrix))
|
&& this._applyMatrix(this._matrix))
|
||||||
// TODO: This needs a _changed notification, but the GEOMETRY
|
|
||||||
// actually doesn't change! What to do?
|
|
||||||
this._matrix.setIdentity();
|
this._matrix.setIdentity();
|
||||||
// We always need to call _changed since we're caching bounds on all
|
// We always need to call _changed since we're caching bounds on all
|
||||||
// items, including Group.
|
// items, including Group.
|
||||||
|
@ -1896,12 +1894,12 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
// Transform position as well.
|
// Transform position as well.
|
||||||
this._position = matrix._transformPoint(position, position);
|
this._position = matrix._transformPoint(position, position);
|
||||||
}
|
}
|
||||||
// PORT: Return 'this' in all chainable commands
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
_applyMatrix: function(matrix) {
|
_applyMatrix: function(matrix) {
|
||||||
// Pass on the transformation to the children, and apply it there too:
|
// Pass on the transformation to the children, and apply it there too,
|
||||||
|
// by passing true for the 2nd hidden parameter.
|
||||||
if (this._children) {
|
if (this._children) {
|
||||||
for (var i = 0, l = this._children.length; i < l; i++)
|
for (var i = 0, l = this._children.length; i < l; i++)
|
||||||
this._children[i].transform(matrix, true);
|
this._children[i].transform(matrix, true);
|
||||||
|
|
|
@ -262,8 +262,6 @@ var Curve = this.Curve = Base.extend(/** @lends Curve# */{
|
||||||
&& this._segment2._handleIn.isZero();
|
&& this._segment2._handleIn.isZero();
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add support for start parameter to Sg
|
|
||||||
// PORT: Rename #getParameter(length) -> #getParameterAt(offset)
|
|
||||||
// DOCS: Document #getParameter(length, start)
|
// DOCS: Document #getParameter(length, start)
|
||||||
/**
|
/**
|
||||||
* @param {Number} offset
|
* @param {Number} offset
|
||||||
|
@ -410,8 +408,6 @@ var Curve = this.Curve = Base.extend(/** @lends Curve# */{
|
||||||
x, y;
|
x, y;
|
||||||
|
|
||||||
// Handle special case at beginning / end of curve
|
// Handle special case at beginning / end of curve
|
||||||
// PORT: Change in Sg too, so 0.000000000001 won't be
|
|
||||||
// required anymore
|
|
||||||
if (type == 0 && (t == 0 || t == 1)) {
|
if (type == 0 && (t == 0 || t == 1)) {
|
||||||
x = t == 0 ? p1x : p2x;
|
x = t == 0 ? p1x : p2x;
|
||||||
y = t == 0 ? p1y : p2y;
|
y = t == 0 ? p1y : p2y;
|
||||||
|
|
|
@ -329,7 +329,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
return segs;
|
return segs;
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add support for adding multiple segments at once to Scriptographer
|
|
||||||
// DOCS: find a way to document the variable segment parameters of Path#add
|
// DOCS: find a way to document the variable segment parameters of Path#add
|
||||||
/**
|
/**
|
||||||
* Adds one or more segments to the end of the {@link #segments} array of
|
* Adds one or more segments to the end of the {@link #segments} array of
|
||||||
|
@ -402,7 +401,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
: this._add([ Segment.read(arguments) ])[0];
|
: this._add([ Segment.read(arguments) ])[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add support for adding multiple segments at once to Scriptographer
|
|
||||||
/**
|
/**
|
||||||
* Inserts one or more segments at a given index in the list of this path's
|
* Inserts one or more segments at a given index in the list of this path's
|
||||||
* segments.
|
* segments.
|
||||||
|
@ -447,17 +445,14 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
addSegment: function(segment) {
|
addSegment: function(segment) {
|
||||||
return this._add([ Segment.read(arguments) ])[0];
|
return this._add([ Segment.read(arguments) ])[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
insertSegment: function(index, segment) {
|
insertSegment: function(index, segment) {
|
||||||
return this._add([ Segment.read(arguments, 1) ], index)[0];
|
return this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
/**
|
/**
|
||||||
* Adds an array of segments (or types that can be converted to segments)
|
* Adds an array of segments (or types that can be converted to segments)
|
||||||
* to the end of the {@link #segments} array.
|
* to the end of the {@link #segments} array.
|
||||||
|
@ -501,7 +496,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
return this._add(Segment.readAll(segments));
|
return this._add(Segment.readAll(segments));
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
/**
|
/**
|
||||||
* Inserts an array of segments at a given index in the path's
|
* Inserts an array of segments at a given index in the path's
|
||||||
* {@link #segments} array.
|
* {@link #segments} array.
|
||||||
|
@ -516,7 +510,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
return this._add(Segment.readAll(segments), index);
|
return this._add(Segment.readAll(segments), index);
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
/**
|
/**
|
||||||
* Removes the segment at the specified index of the path's
|
* Removes the segment at the specified index of the path's
|
||||||
* {@link #segments} array.
|
* {@link #segments} array.
|
||||||
|
@ -543,7 +536,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
return segments[0] || null;
|
return segments[0] || null;
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
/**
|
/**
|
||||||
* Removes all segments from the path's {@link #segments} array.
|
* Removes all segments from the path's {@link #segments} array.
|
||||||
*
|
*
|
||||||
|
@ -1007,7 +999,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Rename functions and add new isParameter argument in Scriptographer
|
|
||||||
// DOCS: document Path#getLocationAt
|
// DOCS: document Path#getLocationAt
|
||||||
/**
|
/**
|
||||||
* {@grouptitle Positions on Paths and Curves}
|
* {@grouptitle Positions on Paths and Curves}
|
||||||
|
@ -1749,7 +1740,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
this.quadraticCurveTo(handle, _to);
|
this.quadraticCurveTo(handle, _to);
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: New implementation back to Scriptographer
|
|
||||||
arcTo: function(to, clockwise /* | through, to */) {
|
arcTo: function(to, clockwise /* | through, to */) {
|
||||||
// Get the start point:
|
// Get the start point:
|
||||||
var current = getCurrentSegment(this),
|
var current = getCurrentSegment(this),
|
||||||
|
|
|
@ -117,8 +117,6 @@ var Style = Item.extend({
|
||||||
} else if (!Base.equals(style, childStyle)) {
|
} else if (!Base.equals(style, childStyle)) {
|
||||||
// If there is another item with a different
|
// If there is another item with a different
|
||||||
// style, the style is not defined:
|
// style, the style is not defined:
|
||||||
// PORT: Change this in Scriptographer
|
|
||||||
// (currently returns null)
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ var Event = this.Event = Base.extend(/** @lends Event# */{
|
||||||
this.event = event;
|
this.event = event;
|
||||||
},
|
},
|
||||||
|
|
||||||
// PORT: Add to Scriptographer
|
|
||||||
preventDefault: function() {
|
preventDefault: function() {
|
||||||
this._prevented = true;
|
this._prevented = true;
|
||||||
DomEvent.preventDefault(this.event);
|
DomEvent.preventDefault(this.event);
|
||||||
|
|
|
@ -599,8 +599,6 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
||||||
if ((curPoint = point || curPoint)
|
if ((curPoint = point || curPoint)
|
||||||
&& tool._onHandleEvent('mousedrag', curPoint, event))
|
&& tool._onHandleEvent('mousedrag', curPoint, event))
|
||||||
DomEvent.stop(event);
|
DomEvent.stop(event);
|
||||||
// PORT: If there is only an onMouseMove handler, also call it when
|
|
||||||
// the user is dragging:
|
|
||||||
} else if ((!dragging || onlyMove)
|
} else if ((!dragging || onlyMove)
|
||||||
&& tool._onHandleEvent('mousemove', point, event)) {
|
&& tool._onHandleEvent('mousemove', point, event)) {
|
||||||
DomEvent.stop(event);
|
DomEvent.stop(event);
|
||||||
|
|
Loading…
Reference in a new issue