Remove all mention of points and square points as units.

And some other doc clean-ups.
This commit is contained in:
Jürg Lehni 2015-09-06 16:37:10 +02:00
parent dd1f5ba3d1
commit cf813faa75
7 changed files with 41 additions and 15 deletions

View file

@ -48,30 +48,30 @@ var Line = Base.extend(/** @lends Line# */{
},
/**
* The starting point of the line
* The starting point of the line.
*
* @name Line#point
* @type Point
* @bean
*/
getPoint: function() {
return new Point(this._px, this._py);
},
/**
* The vector of the line
* The direction of the line as a vector.
*
* @name Line#vector
* @type Point
* @bean
*/
getVector: function() {
return new Point(this._vx, this._vy);
},
/**
* The length of the line
* The length of the line.
*
* @name Line#length
* @type Number
* @bean
*/
getLength: function() {
return this.getVector().getLength();

View file

@ -475,7 +475,7 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
*/
/**
* The area of the rectangle in square points.
* The area of the rectangle.
*
* @type Number
* @bean

View file

@ -1698,7 +1698,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* and may contain a combination of the following values:
*
* @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
* {Number} the tolerance of the hit-test in points
* {Number} the tolerance of the hit-test
* @option options.class {Function} only hit-test again a certain item class
* and its sub-classes: {@code Group, Layer, Path, CompoundPath,
* Shape, Raster, PlacedSymbol, PointText}, etc

View file

@ -220,8 +220,8 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
},
/**
* The area of the path in square points. Self-intersecting paths can
* contain sub-areas that cancel each other out.
* The area that the path's geometry is covering. Self-intersecting paths
* can contain sub-areas that cancel each other out.
*
* @type Number
* @bean

View file

@ -279,10 +279,30 @@ var Curve = Base.extend(/** @lends Curve# */{
this.getPoint2().setSelected(selected);
},
/**
* An array of 8 float values, describing this curve's geometry in four
* absolute x/y pairs (point1, handle1, handle2, point2). This format is
* used internally for efficient processing of curve geometries, e.g. when
* calculating intersections or bounds.
*
* Note that the handles are converted to absolute coordinates.
*
* @type Number[]
* @bean
*/
getValues: function(matrix) {
return Curve.getValues(this._segment1, this._segment2, matrix);
},
/**
* An array of 4 point objects, describing this curve's geometry in absolute
* coordinates (point1, handle1, handle2, point2).
*
* Note that the handles are converted to absolute coordinates.
*
* @type Point[]
* @bean
*/
getPoints: function() {
// Convert to array of absolute points
var coords = this.getValues(),
@ -293,7 +313,7 @@ var Curve = Base.extend(/** @lends Curve# */{
},
/**
* The approximated length of the curve in points.
* The approximated length of the curve.
*
* @type Number
* @bean
@ -308,6 +328,12 @@ var Curve = Base.extend(/** @lends Curve# */{
return this._length;
},
/**
* The area that the curve's geometry is covering.
*
* @type Number
* @bean
*/
getArea: function() {
return Curve.getArea(this.getValues());
},

View file

@ -802,7 +802,7 @@ var Path = PathItem.extend(/** @lends Path# */{
},
/**
* The approximate length of the path in points.
* The approximate length of the path.
*
* @type Number
* @bean
@ -818,8 +818,8 @@ var Path = PathItem.extend(/** @lends Path# */{
},
/**
* The area of the path in square points. Self-intersecting paths can
* contain sub-areas that cancel each other out.
* The area that the path's geometry is covering. Self-intersecting paths
* can contain sub-areas that cancel each other out.
*
* @type Number
* @bean

View file

@ -304,7 +304,7 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* and may contain a combination of the following values:
*
* @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
* {Number} the tolerance of the hit-test in points
* {Number} the tolerance of the hit-test
* @option options.class {Function} only hit-test again a certain item class
* and its sub-classes: {@code Group, Layer, Path, CompoundPath,
* Shape, Raster, PlacedSymbol, PointText}, etc