mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Clean up PORT comments.
This commit is contained in:
parent
f9eca3efbf
commit
9d00541987
6 changed files with 18 additions and 38 deletions
|
@ -57,7 +57,7 @@ var GradientColor = this.GradientColor = Color.extend({
|
|||
},
|
||||
|
||||
setOrigin: function(origin) {
|
||||
// PORT: add clone to Scriptographer
|
||||
// PORT: Add clone to Scriptographer
|
||||
origin = Point.read(arguments).clone();
|
||||
this._origin = origin;
|
||||
if (this._destination)
|
||||
|
@ -76,7 +76,7 @@ var GradientColor = this.GradientColor = Color.extend({
|
|||
},
|
||||
|
||||
setDestination: function(destination) {
|
||||
// PORT: add clone to Scriptographer
|
||||
// PORT: Add clone to Scriptographer
|
||||
destination = Point.read(arguments).clone();
|
||||
this._destination = destination;
|
||||
this._radius = this._destination.getDistance(this._origin);
|
||||
|
@ -94,7 +94,7 @@ var GradientColor = this.GradientColor = Color.extend({
|
|||
},
|
||||
|
||||
setHilite: function(hilite) {
|
||||
// PORT: add clone to Scriptographer
|
||||
// PORT: Add clone to Scriptographer
|
||||
hilite = Point.read(arguments).clone();
|
||||
var vector = hilite.subtract(this._origin);
|
||||
if (vector.getLength() > this._radius) {
|
||||
|
|
|
@ -125,7 +125,8 @@ var PathStyle = this.PathStyle = Base.extend(new function() {
|
|||
&& style.equals(childStyle))) {
|
||||
// If there is another item with a different style,
|
||||
// the style is not defined:
|
||||
// PORT: Change this in Sg (currently returns null)
|
||||
// PORT: Change this in Scriptographer
|
||||
// (currently returns null)
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ var Curve = this.Curve = Base.extend({
|
|||
&& this._segment2._handleIn.isZero();
|
||||
},
|
||||
|
||||
// PORT: Add support for start parameter to Sg
|
||||
// PORT: Add support for start parameter to Scriptographer
|
||||
// DOCS: document Curve#getParameter(length, start)
|
||||
/**
|
||||
* @param {Number} length
|
||||
|
@ -328,7 +328,7 @@ var Curve = this.Curve = Base.extend({
|
|||
x, y;
|
||||
|
||||
// Handle special case at beginning / end of curve
|
||||
// PORT: Change in Sg too, so 0.000000000001 won't be
|
||||
// PORT: Change in Scriptographer too, so 0.000000000001 won't be
|
||||
// required anymore
|
||||
if (t == 0 || t == 1) {
|
||||
var point;
|
||||
|
|
|
@ -275,7 +275,7 @@ var Path = this.Path = PathItem.extend({
|
|||
this._project._selectItem(this, count == 1);
|
||||
},
|
||||
|
||||
// PORT: Add support for adding multiple segments at once to Sg
|
||||
// PORT: Add support for adding multiple segments at once to Scriptographer
|
||||
// DOCS: find a way to document the variable segment parameters of Path#add
|
||||
/**
|
||||
* Adds one or more segments to the end of the segment list of this path.
|
||||
|
@ -293,7 +293,7 @@ var Path = this.Path = PathItem.extend({
|
|||
: this._add([ Segment.read(arguments) ])[0];
|
||||
},
|
||||
|
||||
// PORT: Add support for adding multiple segments at once to Sg
|
||||
// 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
|
||||
* segments.
|
||||
|
@ -311,17 +311,17 @@ var Path = this.Path = PathItem.extend({
|
|||
: this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
addSegment: function(segment) {
|
||||
return this._add([ Segment.read(arguments) ])[0];
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
insertSegment: function(index, segment) {
|
||||
return this._add([ Segment.read(arguments, 1) ], index)[0];
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
/**
|
||||
* Adds an array of segments (or types that can be converted to segments)
|
||||
* to the end of the {@link #segments} array.
|
||||
|
@ -340,7 +340,7 @@ var Path = this.Path = PathItem.extend({
|
|||
return this._add(Segment.readAll(segments));
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
/**
|
||||
* Inserts an array of segments at a given index in the path's
|
||||
* {@link #segments} array.
|
||||
|
@ -355,7 +355,7 @@ var Path = this.Path = PathItem.extend({
|
|||
return this._add(Segment.readAll(segments), index);
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
/**
|
||||
* Removes the segment at the specified index of the path's
|
||||
* {@link #segments} array.
|
||||
|
@ -368,7 +368,7 @@ var Path = this.Path = PathItem.extend({
|
|||
return segments[0] || null;
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
/**
|
||||
* Removes the segments from the specified 'from' index to the specified
|
||||
* 'to' index from the path's {@link #segments} array.
|
||||
|
@ -592,7 +592,7 @@ var Path = this.Path = PathItem.extend({
|
|||
},
|
||||
|
||||
// TODO: getLocationAt(point, precision)
|
||||
// PORT: Rename functions and add new isParameter argument in Sg
|
||||
// PORT: Rename functions and add new isParameter argument in Scriptographer
|
||||
// DOCS: document Path#getLocationAt
|
||||
/**
|
||||
* @param {Number} offset
|
||||
|
|
|
@ -21,7 +21,7 @@ var Event = this.Event = Base.extend({
|
|||
this.event = event;
|
||||
},
|
||||
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
preventDefault: function() {
|
||||
DomEvent.preventDefault(this.event);
|
||||
},
|
||||
|
|
|
@ -14,10 +14,6 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace
|
||||
* @name Key
|
||||
*/
|
||||
var Key = this.Key = new function() {
|
||||
// TODO: make sure the keys are called the same as in Scriptographer
|
||||
// Missing: tab, cancel, clear, page-down, page-up, comma, minus, period,
|
||||
|
@ -76,7 +72,7 @@ var Key = this.Key = new function() {
|
|||
// Call the onKeyDown or onKeyUp handler if present
|
||||
// When the handler function returns false, prevent the
|
||||
// default behaviour of the key event:
|
||||
// PORT: Add to Sg
|
||||
// PORT: Add to Scriptographer
|
||||
var keyEvent = new KeyEvent(down, key, character, event);
|
||||
if (tool[handler](keyEvent) === false)
|
||||
keyEvent.preventDefault();
|
||||
|
@ -131,25 +127,8 @@ var Key = this.Key = new function() {
|
|||
});
|
||||
|
||||
return {
|
||||
/** @lends Key */
|
||||
|
||||
modifiers: modifiers,
|
||||
|
||||
/**
|
||||
* Checks whether the specified key is pressed.
|
||||
*
|
||||
* @example
|
||||
* function onMouseDown(event) {
|
||||
* if(Key.isDown('shift')) {
|
||||
* console.log('The shift key is currently pressed.')
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @param {String} key One of: 'backspace', 'enter', 'shift', 'control',
|
||||
* 'option', 'pause', 'caps-lock', 'escape', 'space', 'end', 'home',
|
||||
* 'left', 'up', 'right', 'down', 'delete', 'command'
|
||||
* @return {boolean} {@true if the key is pressed}
|
||||
*/
|
||||
isDown: function(key) {
|
||||
return !!keyMap[key];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue