diff --git a/dist/docs/classes/CharacterStyle.html b/dist/docs/classes/CharacterStyle.html index 7b2ea6e5..b1692846 100644 --- a/dist/docs/classes/CharacterStyle.html +++ b/dist/docs/classes/CharacterStyle.html @@ -1,6 +1,7 @@
+Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Extends CurveLocation
- +A HitResult object contains information about the results of a hit +test. It is returned by item.hitTest(point) and +project.hitTest(point).
@@ -26,15 +29,142 @@ +Describes the type of the hit result. For example, if you hit a segment +point, the type would be 'segment'.
+ +If the HitResult has a hitResult.type of 'bounds', this property +describes which corner of the bounding rectangle was hit.
+ + +If the HitResult has a type of 'stroke', this property gives more +information about the exact position that was hit on the path.
+ + +The segment of the curve which is closer to the described location.
+If the HitResult has a type of 'stroke', 'segment', 'handle-in' or +'handle-out', this property refers to the Segment that was hit or that +is closest to the hitResult.location on the curve.
Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +- [ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ] - [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ] - [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ] + [ x ] [ a b tx ] [ x ] [ a * x + b * y + tx ] + [ y ] = [ c d ty ] [ y ] = [ c * x + d * y + ty ] + [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
This class is optimized for speed and minimizes calculations based on its knowledge of the underlying matrix (as opposed to say simply performing @@ -39,18 +40,18 @@ matrix multiplication).
The scaling factor in the x-direction (a).
+ + +The scaling factor in the y-direction (d).
+ + +The translation in the x-direction (tx).
+ + +The translation in the y-direction (ty).
+ + +Returns the rotation angle of the matrix. If a non-uniform +rotation is applied as a result of a shear() or scale() command, +undefined is returned, as the resulting transformation cannot be +expressed in one rotation angle
Inverts the transformation of the matrix. If the matrix is not invertible +(in which case isSingular() returns true), null is +returned.
The PaperScope class represents the scope associated with a +Paper context. When working with PaperScript, these scopes are automatically +created for us, and through clever scoping the properties and methods of the +active scope seem to become part of the global scope.
+When working with normal JavaScript code, PaperScope objects need to +be manually created and handled.
+Paper classes can only be accessed through PaperScope objects. Thus +in PaperScript they are global, while in JavaScript, they are available on +the global paper object. For JavaScript you can use +paperScope.install(scope) to install the Paper classes and objects +on the global scope. Note that when working with more than one scope, this +still works for classes, but not for objects like paperScope.project, +since they are not updated in the injected scope if scopes are switched.
+The global paper object is simply a reference to the currently active +PaperScope.
+ +Creates a PaperScope object.
+ + + + +The version of Paper.js, as a float number.
+ + +Injects the paper scope into any other given scope. Can be used for +examle to inject the currently active PaperScope into the window's global +scope, to emulate PaperScript-style globally accessible Paper classes and +objects:
+ ++Example +
+ + +paper.install(window);+ +
Sets up an empty project for us. If a canvas is provided, it also creates +a View for it, both linked to this scope.
+ +Retrieves a PaperScope object with the given id or associated with +the passed canvas element.
+ +Iterates over all active scopes and calls the passed iterator +function for each of them.
+ +Copyright © 2011 Jürg Lehni & Jonathan Puckey. All Rights Reserved.
+ + + \ No newline at end of file diff --git a/dist/docs/classes/PaperScript.html b/dist/docs/classes/PaperScript.html new file mode 100644 index 00000000..9714c10d --- /dev/null +++ b/dist/docs/classes/PaperScript.html @@ -0,0 +1,137 @@ + + + + +Compiles PaperScript code into JavaScript code.
+ +Evaluates parsed PaperScript code in the passed PaperScope +object. It also installs handlers automatically for us.
+ +Copyright © 2011 Jürg Lehni & Jonathan Puckey. All Rights Reserved.
+ + + \ No newline at end of file diff --git a/dist/docs/classes/ParagraphStyle.html b/dist/docs/classes/ParagraphStyle.html index b6cffc2f..b0b4aa4d 100644 --- a/dist/docs/classes/ParagraphStyle.html +++ b/dist/docs/classes/ParagraphStyle.html @@ -1,6 +1,7 @@ +Returns the nearest location on the path to the specified point.
+ +Returns the nearest point on the path to the specified point.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +A Project object in Paper.js is what usually is refered to as the +
A Project object in Paper.js is what usually is referred to as the document: The top level object that holds all the items contained in the scene graph. As the term document is already taken in the browser context, it is called Project.
@@ -25,10 +26,10 @@ created items, give access to the selected items, and will in future versions offer ways to query for items in the scene graph defining specific requirements, and means to persist and load from different formats, such as SVG and PDF. -The currently active project can be accessed through the global -{@see _global_#project} variable.
-An array of all open projects is accessible through the global -{@see _global_#projects} variable.
+The currently active project can be accessed through the +paperScope.project variable.
+An array of all open projects is accessible through the +paperScope.projects variable.
Creates a Paper.js project.
When working with PaperScript, a project is automatically created for us -and the global {@see _global_#project} variable points to it.
+and the paperScope.project variable points to it. @@ -158,7 +159,7 @@ var path2 = new Path.Circle(new Point(175, 50), 20);The index of the project in the global projects array.
+The index of the project in the paperScope.projects list.
Removes this project from the global {@see _global_#projects} list.
+Removes this project from the paperScope.projects list.
@@ -472,6 +473,83 @@ in it. +Perform a hit test on the items contained within the project at the +location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+fill: Boolean - Hit test the fill of items.
+stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+segment: Boolean - Hit test for segment.point of +Path items.
+handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+ends: Boolean - Only hit test for the first or last +segment points of open path items.
+bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+guide: Boolean - Hit test items that have +item.guide set to true.
+selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Perform a hit test on the item (and its children, if it is a +Group or Layer) at the location of the specified point.
+The optional options object allows you to control the specifics of the +hit test and may contain a combination of the following values:
+tolerance: Number - The tolerance of the hit test in +points.
+options.type: Only hit test again a certain item +type: PathItem, Raster, TextItem, etc.
+options.fill: Boolean - Hit test the fill of items.
+options.stroke: Boolean - Hit test the curves of path items, +taking into account stroke width.
+options.segment: Boolean - Hit test for segment.point of +Path items.
+options.handles: Boolean - Hit test for the handles +(segment.handleIn / segment.handleOut) of path segments.
+options.ends: Boolean - Only hit test for the first or last +segment points of open path items.
+options.bounds: Boolean - Hit test the corners and side-centers +of the bounding rectangle of items (item.bounds).
+options.center: Boolean - Hit test the rectangle.center +of the bounding rectangle of items (item.bounds).
+options.guide: Boolean - Hit test items that have +item.guide set to true.
+options.selected: Boolean - Only hit selected items.
+ +Initializes the tool's settings, so a new tool can be assigned to it
- -The item at the position of the mouse (if any).
+If the item is contained within one or more Group or +CompoundPath items, the most top level group or compound path +that it is contained within is returned.
+ + +The version of Paper.js, as a float number.
+A reference to the currently active PaperScope object.
The active view of the active project.
+The list of view of the active project.
@@ -203,7 +206,7 @@The reference to the tool object.
+The reference to the active tool.