diff --git a/src/basic/Line.js b/src/basic/Line.js index 3d143109..28c6883c 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -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(); diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index e26f27f7..c6b89ba0 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -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 diff --git a/src/item/Item.js b/src/item/Item.js index 122f4f2f..722947e8 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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 diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index fb285478..53e4a359 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -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 diff --git a/src/path/Curve.js b/src/path/Curve.js index 26f5b797..1efe9ef7 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -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()); }, diff --git a/src/path/Path.js b/src/path/Path.js index a5d44c7b..b895e990 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -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 diff --git a/src/project/Project.js b/src/project/Project.js index b5a96710..e9316366 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -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