mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Remove all code blocks and group titles from documentation since we're relying on Scriptographer code and documentation generation (through javadoc) for docs.
This commit is contained in:
parent
dbef57ec8c
commit
2c078d8b17
7 changed files with 4 additions and 338 deletions
|
@ -62,15 +62,6 @@ var Point = this.Point = Base.extend({
|
|||
* Returns a copy of the point.
|
||||
* This is useful as the following code only generates a flat copy:
|
||||
*
|
||||
* <code>
|
||||
* var point1 = new Point();
|
||||
* var point2 = point1;
|
||||
* point2.x = 1; // also changes point1.x
|
||||
*
|
||||
* var point2 = point1.clone();
|
||||
* point2.x = 1; // doesn't change point1.x
|
||||
* </code>
|
||||
*
|
||||
* @return the cloned point
|
||||
*/
|
||||
clone: function() {
|
||||
|
@ -117,19 +108,6 @@ var Point = this.Point = Base.extend({
|
|||
|
||||
/**
|
||||
* Returns the distance between the point and another point.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var firstPoint = new Point(5, 10);
|
||||
* var secondPoint = new Point(5, 20);
|
||||
*
|
||||
* var distance = firstPoint.getDistance(secondPoint);
|
||||
*
|
||||
* print(distance); // 10
|
||||
* </code>
|
||||
*
|
||||
* @param px
|
||||
* @param py
|
||||
*/
|
||||
getDistance: function(point) {
|
||||
point = Point.read(arguments);
|
||||
|
@ -187,8 +165,6 @@ var Point = this.Point = Base.extend({
|
|||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Angle & Rotation}
|
||||
*
|
||||
* The vector's angle, measured from the x-axis to the vector.
|
||||
*
|
||||
* When supplied with a point, returns the smaller angle between two
|
||||
|
@ -296,8 +272,6 @@ var Point = this.Point = Base.extend({
|
|||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Tests}
|
||||
*
|
||||
* Checks whether the point is inside the boundaries of the rectangle.
|
||||
*
|
||||
* @param rect the rectangle to check against
|
||||
|
@ -358,62 +332,8 @@ var Point = this.Point = Base.extend({
|
|||
isNaN: function() {
|
||||
return isNaN(this.x) || isNaN(this.y);
|
||||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Math Functions}
|
||||
*
|
||||
* Returns a new point with rounded {@link #x} and {@link #y} values. The
|
||||
* object itself is not modified!
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var point = new Point(10.2, 10.9);
|
||||
* var roundPoint = point.round();
|
||||
* print(roundPoint); // { x: 10.0, y: 11.0 }
|
||||
* </code>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a new point with the nearest greater non-fractional values to the
|
||||
* specified {@link #x} and {@link #y} values. The object itself is not
|
||||
* modified!
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var point = new Point(10.2, 10.9);
|
||||
* var ceilPoint = point.ceil();
|
||||
* print(ceilPoint); // { x: 11.0, y: 11.0 }
|
||||
* </code>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a new point with the nearest smaller non-fractional values to the
|
||||
* specified {@link #x} and {@link #y} values. The object itself is not
|
||||
* modified!
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var point = new Point(10.2, 10.9);
|
||||
* var floorPoint = point.floor();
|
||||
* print(floorPoint); // { x: 10.0, y: 10.0 }
|
||||
* </code>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a new point with the absolute values of the specified {@link #x}
|
||||
* and {@link #y} values. The object itself is not modified!
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var point = new Point(-5, 10);
|
||||
* var absPoint = point.abs();
|
||||
* print(absPoint); // { x: 5.0, y: 10.0 }
|
||||
* </code>
|
||||
*/
|
||||
|
||||
/**
|
||||
* {@grouptitle Vectorial Math Functions}
|
||||
*
|
||||
* Returns the dot product of the point and another point.
|
||||
* @param point
|
||||
* @return the dot product of the two points
|
||||
|
@ -479,14 +399,6 @@ var Point = this.Point = Base.extend({
|
|||
* Returns a new point object with the smallest {@link #x} and
|
||||
* {@link #y} of the supplied points.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var point1 = new Point(10, 100);
|
||||
* var point2 = new Point(200, 5);
|
||||
* var minPoint = Point.min(point1, point2);
|
||||
* print(minPoint); // { x: 10.0, y: 5.0 }
|
||||
* </code>
|
||||
*
|
||||
* @param point1
|
||||
* @param point2
|
||||
* @return The newly created point object
|
||||
|
@ -504,14 +416,6 @@ var Point = this.Point = Base.extend({
|
|||
* Returns a new point object with the largest {@link #x} and
|
||||
* {@link #y} of the supplied points.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var point1 = new Point(10, 100);
|
||||
* var point2 = new Point(200, 5);
|
||||
* var maxPoint = Point.max(point1, point2);
|
||||
* print(maxPoint); // { x: 200.0, y: 100.0 }
|
||||
* </code>
|
||||
*
|
||||
* @param point1
|
||||
* @param point2
|
||||
* @return The newly created point object
|
||||
|
@ -528,15 +432,6 @@ var Point = this.Point = Base.extend({
|
|||
/**
|
||||
* Returns a point object with random {@link #x} and {@link #y} values
|
||||
* between {@code 0} and {@code 1}.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var maxPoint = new Point(100, 100);
|
||||
* var randomPoint = Point.random();
|
||||
*
|
||||
* // A point between {x:0, y:0} and {x:100, y:100}:
|
||||
* var point = maxPoint * randomPoint;
|
||||
* </code>
|
||||
*/
|
||||
random: function() {
|
||||
return Point.create(Math.random(), Math.random());
|
||||
|
|
|
@ -33,12 +33,6 @@ var Group = this.Group = Item.extend({
|
|||
* When setting to true, the first child in the group is automatically
|
||||
* defined as the clipping mask.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var group = new Group();
|
||||
* group.appendChild(path);
|
||||
* group.clipped = true;
|
||||
* </code>
|
||||
* @return {@true if the group item is to be clipped}
|
||||
*/
|
||||
isClipped: function() {
|
||||
|
|
176
src/item/Item.js
176
src/item/Item.js
|
@ -125,13 +125,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Specifies whether the item is locked.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var path = new Path();
|
||||
* print(path.locked) // false
|
||||
* path.locked = true; // Locks the path
|
||||
* </code>
|
||||
*
|
||||
* @return {@true if the item is locked}
|
||||
*/
|
||||
locked: false,
|
||||
|
@ -139,13 +132,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Specifies whether the item is visible.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var path = new Path();
|
||||
* print(path.visible) // true
|
||||
* path.visible = false; // Hides the path
|
||||
* </code>
|
||||
*
|
||||
* @return {@true if the item is visible}
|
||||
*/
|
||||
visible: true,
|
||||
|
@ -153,46 +139,19 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* The opacity of the item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* // Create a circle at position { x: 10, y: 10 }
|
||||
* var circle = new Path.Circle(new Point(10, 10), 10);
|
||||
*
|
||||
* // Change the opacity of the circle to 50%:
|
||||
* circle.opacity = 0.5;
|
||||
* </code>
|
||||
*
|
||||
* @return the opacity of the item as a value between 0 and 1.
|
||||
*/
|
||||
opacity: 1,
|
||||
|
||||
/**
|
||||
* The blend mode of the item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var circle = new Path.Circle(new Point(50, 50), 10);
|
||||
* print(circle.blendMode); // normal
|
||||
*
|
||||
* // Change the blend mode of the path item:
|
||||
* circle.blendMode = 'multiply';
|
||||
* </code>
|
||||
*/
|
||||
blendMode: 'normal',
|
||||
|
||||
/**
|
||||
* Specifies whether the item is hidden.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var path = new Path();
|
||||
* print(path.hidden); // false
|
||||
* path.hidden = true; // Hides the path
|
||||
* </code>
|
||||
*
|
||||
* @return {@true if the item is hidden}
|
||||
*
|
||||
* @jshide
|
||||
*/
|
||||
isHidden: function() {
|
||||
return !this.visible;
|
||||
|
@ -207,14 +166,6 @@ var Item = this.Item = Base.extend({
|
|||
* paths, compound paths, and text frame objects, and only if the item is
|
||||
* already contained within a clipping group.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var group = new Group();
|
||||
* group.appendChild(path);
|
||||
* group.clipped = true;
|
||||
* path.clipMask = true;
|
||||
* </code>
|
||||
*
|
||||
* @return {@true if the item defines a clip mask}
|
||||
*/
|
||||
isClipMask: function() {
|
||||
|
@ -282,7 +233,8 @@ var Item = this.Item = Base.extend({
|
|||
* The last item contained within this item.
|
||||
*/
|
||||
getLastChild: function() {
|
||||
return this._children && this._children[this._children.length - 1] || null;
|
||||
return this._children && this._children[this._children.length - 1]
|
||||
|| null;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -321,8 +273,6 @@ var Item = this.Item = Base.extend({
|
|||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Tests}
|
||||
*
|
||||
* Checks if the item contains any children items.
|
||||
*
|
||||
* @return {@true if it has one or more children}
|
||||
|
@ -350,31 +300,14 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Checks whether the item is valid, i.e. it hasn't been removed.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var path = new Path();
|
||||
* print(path.isValid()); // true
|
||||
* path.remove();
|
||||
* print(path.isValid()); // false
|
||||
* </code>
|
||||
*
|
||||
* @return {@true if the item is valid}
|
||||
*/
|
||||
// TODO: isValid / checkValid
|
||||
|
||||
/**
|
||||
* {@grouptitle Hierarchy Tests}
|
||||
*
|
||||
* Checks if this item is above the specified item in the stacking order of
|
||||
* the document.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var firstPath = new Path();
|
||||
* var secondPath = new Path();
|
||||
* print(secondPath.isAbove(firstPath)); // true
|
||||
* </code>
|
||||
*
|
||||
* @param item The item to check against
|
||||
* @return {@true if it is above the specified item}
|
||||
*/
|
||||
|
@ -384,13 +317,6 @@ var Item = this.Item = Base.extend({
|
|||
* Checks if the item is below the specified item in the stacking order of
|
||||
* the document.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var firstPath = new Path();
|
||||
* var secondPath = new Path();
|
||||
* print(firstPath.isBelow(secondPath)); // true
|
||||
* </code>
|
||||
*
|
||||
* @param item The item to check against
|
||||
* @return {@true if it is below the specified item}
|
||||
*/
|
||||
|
@ -407,14 +333,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Checks if the item is contained within the specified item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var group = new Group();
|
||||
* var path = new Path();
|
||||
* group.appendTop(path);
|
||||
* print(path.isDescendant(group)); // true
|
||||
* </code>
|
||||
*
|
||||
* @param item The item to check against
|
||||
* @return {@true if it is inside the specified item}
|
||||
*/
|
||||
|
@ -430,15 +348,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Checks if the item is an ancestor of the specified item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var group = new Group();
|
||||
* var path = new Path();
|
||||
* group.appendChild(path);
|
||||
* print(group.isAncestor(path)); // true
|
||||
* print(path.isAncestor(group)); // false
|
||||
* </code>
|
||||
*
|
||||
* @param item the item to check against
|
||||
* @return {@true if the item is an ancestor of the specified item}
|
||||
*/
|
||||
|
@ -568,19 +477,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* The item's position within the art board. This is the
|
||||
* {@link Rectangle#getCenter()} of the {@link Item#getBounds()} rectangle.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* // Create a circle at position { x: 10, y: 10 }
|
||||
* var circle = new Path.Circle(new Point(10, 10), 10);
|
||||
*
|
||||
* // Move the circle to { x: 20, y: 20 }
|
||||
* circle.position = new Point(20, 20);
|
||||
*
|
||||
* // Move the circle 10 points to the right
|
||||
* circle.position += new Point(10, 0);
|
||||
* print(circle.position); // { x: 30, y: 20 }
|
||||
* </code>
|
||||
*/
|
||||
getPosition: function() {
|
||||
// Cache position value
|
||||
|
@ -628,22 +524,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Translates (moves) the item by the given offset point.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* // Create a circle at position { x: 10, y: 10 }
|
||||
* var circle = new Path.Circle(new Point(10, 10), 10);
|
||||
* circle.translate(new Point(5, 10));
|
||||
* print(circle.position); // {x: 15, y: 20}
|
||||
* </code>
|
||||
*
|
||||
* Alternatively you can also add to the {@link #getPosition()} of the item:
|
||||
* <code>
|
||||
* // Create a circle at position { x: 10, y: 10 }
|
||||
* var circle = new Path.Circle(new Point(10, 10), 10);
|
||||
* circle.position += new Point(5, 10);
|
||||
* print(circle.position); // {x: 15, y: 20}
|
||||
* </code>
|
||||
*
|
||||
* @param delta
|
||||
*/
|
||||
translate: function(delta) {
|
||||
|
@ -652,8 +532,6 @@ var Item = this.Item = Base.extend({
|
|||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Transform Functions}
|
||||
*
|
||||
* Scales the item by the given values from its center point, or optionally
|
||||
* by a supplied point.
|
||||
*
|
||||
|
@ -708,16 +586,6 @@ var Item = this.Item = Base.extend({
|
|||
|
||||
/**
|
||||
* The path style of the item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var circle = new Path.Circle(new Point(10, 10), 10);
|
||||
* circle.style = {
|
||||
* fillColor: new RGBColor(1, 0, 0),
|
||||
* strokeColor: new RGBColor(0, 1, 0),
|
||||
* strokeWidth: 5
|
||||
* };
|
||||
* </code>
|
||||
*/
|
||||
getStyle: function() {
|
||||
return this._style;
|
||||
|
@ -866,20 +734,10 @@ var Item = this.Item = Base.extend({
|
|||
|
||||
return {
|
||||
/**
|
||||
* {@grouptitle Hierarchy Operations}
|
||||
*
|
||||
* Inserts the specified item as a child of the item by appending it to
|
||||
* the list of children and moving it above all other children. You can
|
||||
* use this function for groups, compound paths and layers.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var group = new Group();
|
||||
* var path = new Path();
|
||||
* group.appendTop(path);
|
||||
* print(path.isDescendant(group)); // true
|
||||
* </code>
|
||||
*
|
||||
*
|
||||
* @param item The item that will be appended as a child
|
||||
*/
|
||||
appendTop: append(true),
|
||||
|
@ -889,14 +747,6 @@ var Item = this.Item = Base.extend({
|
|||
* the list of children and moving it below all other children. You can
|
||||
* use this function for groups, compound paths and layers.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var group = new Group();
|
||||
* var path = new Path();
|
||||
* group.appendBottom(path);
|
||||
* print(path.isDescendant(group)); // true
|
||||
* </code>
|
||||
*
|
||||
* @param item The item that will be appended as a child
|
||||
*/
|
||||
appendBottom: append(false),
|
||||
|
@ -913,15 +763,6 @@ var Item = this.Item = Base.extend({
|
|||
/**
|
||||
* Moves this item above the specified item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var firstPath = new Path();
|
||||
* var secondPath = new Path();
|
||||
* print(firstPath.isAbove(secondPath)); // false
|
||||
* firstPath.moveAbove(secondPath);
|
||||
* print(firstPath.isAbove(secondPath)); // true
|
||||
* </code>
|
||||
*
|
||||
* @param item The item above which it should be moved
|
||||
* @return true if it was moved, false otherwise
|
||||
*/
|
||||
|
@ -929,16 +770,7 @@ var Item = this.Item = Base.extend({
|
|||
|
||||
/**
|
||||
* Moves the item below the specified item.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* var firstPath = new Path();
|
||||
* var secondPath = new Path();
|
||||
* print(secondPath.isBelow(firstPath)); // false
|
||||
* secondPath.moveBelow(firstPath);
|
||||
* print(secondPath.isBelow(firstPath)); // true
|
||||
* </code>
|
||||
*
|
||||
*
|
||||
* @param item the item below which it should be moved
|
||||
* @return true if it was moved, false otherwise
|
||||
*/
|
||||
|
|
|
@ -136,8 +136,6 @@ var Raster = this.Raster = Item.extend({
|
|||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Pixels}
|
||||
*
|
||||
* Gets the color of a pixel in the raster.
|
||||
* @param x
|
||||
* @param y
|
||||
|
@ -234,7 +232,6 @@ var Raster = this.Raster = Item.extend({
|
|||
|
||||
return {
|
||||
/**
|
||||
* {@grouptitle Average Color}
|
||||
* Calculates the average color of the image within the given path,
|
||||
* rectangle or point. This can be used for creating raster image
|
||||
* effects.
|
||||
|
|
|
@ -111,13 +111,6 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
|
|||
* event is called repeatedly after the initial {@link #onMouseDown}
|
||||
* until the user releases the mouse.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* // Fire the onMouseDrag event once a second,
|
||||
* // while the mouse button is down
|
||||
* tool.eventInterval = 1000;
|
||||
* </code>
|
||||
*
|
||||
* @return the interval time in milliseconds
|
||||
*/
|
||||
eventInterval: null
|
||||
|
|
|
@ -20,16 +20,6 @@
|
|||
* {@link Tool#getOnMouseMove()} and {@link Tool#getOnMouseUp()}. The ToolEvent
|
||||
* object is the only parameter passed to these functions and contains
|
||||
* information about the mouse event.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* function onMouseUp(event) {
|
||||
* // the position of the mouse when it is released
|
||||
* print(event.point);
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @author lehni
|
||||
*/
|
||||
var ToolEvent = this.ToolEvent = Base.extend({
|
||||
beans: true,
|
||||
|
@ -51,19 +41,6 @@ var ToolEvent = this.ToolEvent = Base.extend({
|
|||
/**
|
||||
* The position of the mouse in document coordinates when the event was
|
||||
* fired.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* function onMouseDrag(event) {
|
||||
* // the position of the mouse when it is dragged
|
||||
* print(event.point);
|
||||
* }
|
||||
*
|
||||
* function onMouseUp(event) {
|
||||
* // the position of the mouse when it is released
|
||||
* print(event.point);
|
||||
* }
|
||||
* </code>
|
||||
*/
|
||||
getPoint: function() {
|
||||
return this._choosePoint(this._point, this.tool._point);
|
||||
|
@ -138,21 +115,6 @@ var ToolEvent = this.ToolEvent = Base.extend({
|
|||
|
||||
/**
|
||||
* The number of times the mouse event was fired.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* function onMouseDrag(event) {
|
||||
* // the amount of times the onMouseDrag event was fired
|
||||
* // since the last onMouseDown event
|
||||
* print(event.count);
|
||||
* }
|
||||
*
|
||||
* function onMouseUp(event) {
|
||||
* // the amount of times the onMouseUp event was fired
|
||||
* // since the tool was activated
|
||||
* print(event.point);
|
||||
* }
|
||||
* </code>
|
||||
*/
|
||||
getCount: function() {
|
||||
// Return downCount for both mouse down and up, since
|
||||
|
|
|
@ -33,13 +33,6 @@ var ToolHandler = this.ToolHandler = Base.extend({
|
|||
/**
|
||||
* The minimum distance the mouse has to drag before firing the onMouseDrag
|
||||
* event, since the last onMouseDrag event.
|
||||
*
|
||||
* Sample code:
|
||||
* <code>
|
||||
* // Fire the onMouseDrag event after the user has dragged more then 5
|
||||
* // points from the last onMouseDrag event:
|
||||
* tool.minDistance = 5;
|
||||
* </code>
|
||||
*/
|
||||
getMinDistance: function() {
|
||||
return this._minDistance;
|
||||
|
|
Loading…
Reference in a new issue