Increase version to 0.21, supporting tools in direct JavaScript mode, including support for multiple tools.

This commit is contained in:
Jürg Lehni 2011-08-02 10:09:40 +01:00
parent fe97b94340
commit 0bbb4640ce
16 changed files with 392 additions and 223 deletions

View file

@ -31,7 +31,7 @@
# stripped Formated but without comments
# compressed Uses UglifyJS to reduce file size
VERSION=0.2
VERSION=0.21
DATE=$(git log -1 --pretty=format:%ad)
COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\" }' -d '$4' $2"

View file

@ -2584,18 +2584,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1789,18 +1789,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1654,18 +1654,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1748,18 +1748,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -4900,18 +4900,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -2481,18 +2481,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1695,18 +1695,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1781,18 +1781,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1744,18 +1744,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -2365,18 +2365,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -1802,18 +1802,19 @@ points.</p>
<p><b>options.type:</b> Only hit test again a certain item
type: <a href="../classes/PathItem.html"><tt>PathItem</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/TextItem.html"><tt>TextItem</tt></a>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> - Hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path items,
taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
<a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> - Hit test the curves of path
items, taking into account stroke width.</p>
<p><b>options.segment:</b> <tt>Boolean</tt> - Hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> - Hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or last
segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and side-centers
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a>
of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.ends:</b> <tt>Boolean</tt> - Only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> - Hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> - Hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guide:</b> <tt>Boolean</tt> - Hit test items that have
<a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> - Only hit selected items.</p>

View file

@ -518,6 +518,62 @@ keys.</p>
<!-- ============================== methods ================================ -->
<div class="reference-members"><h2>Methods</h2>
<div id="activate-member" class="member">
<div id="activate-link" class="member-link">
<a name="activate" href="#" onClick="return toggleMember('activate', false);"><tt><b>activate</b>()</tt></a>
</div>
<div id="activate-description" class="member-description hidden">
<div class="member-header">
<div class="member-title">
<div class="member-link">
<a href="#" onClick="return toggleMember('activate', false);"><tt><b>activate</b>()</tt></a>
</div>
</div>
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('activate', false);"></div>
<div class="clear"></div>
</div>
<div class="member-text">
<p>Activates this tool, meaning <a href="../classes/PaperScope.html#tool"><tt>paperScope.tool</tt></a> will
point to it and it will be the one that recieves mouse events.</p>
</div>
</div>
</div>
<div id="remove-member" class="member">
<div id="remove-link" class="member-link">
<a name="remove" href="#" onClick="return toggleMember('remove', false);"><tt><b>remove</b>()</tt></a>
</div>
<div id="remove-description" class="member-description hidden">
<div class="member-header">
<div class="member-title">
<div class="member-link">
<a href="#" onClick="return toggleMember('remove', false);"><tt><b>remove</b>()</tt></a>
</div>
</div>
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('remove', false);"></div>
<div class="clear"></div>
</div>
<div class="member-text">
<p>Removes this tool from the <a href="../classes/PaperScope.html#tools"><tt>paperScope.tools</tt></a> list.</p>
</div>
</div>
</div>
</div>

View file

@ -50,8 +50,9 @@ screen.</p>
<li>
<tt>canvas:</tt>
<tt>Canvas</tt>
<tt>HTMLCanvasElement</tt> / <tt>String</tt>
&mdash;&nbsp;The canvas object that this
view should wrap, or the String id that represents it
</li>
@ -379,6 +380,58 @@ function onResize(event) {
<div class="reference-members"><h2>Methods</h2>
<div id="activate-member" class="member">
<div id="activate-link" class="member-link">
<a name="activate" href="#" onClick="return toggleMember('activate', false);"><tt><b>activate</b>()</tt></a>
</div>
<div id="activate-description" class="member-description hidden">
<div class="member-header">
<div class="member-title">
<div class="member-link">
<a href="#" onClick="return toggleMember('activate', false);"><tt><b>activate</b>()</tt></a>
</div>
</div>
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('activate', false);"></div>
<div class="clear"></div>
</div>
<div class="member-text">
<p>Makes this view the active one, meaning <a href="../classes/PaperScope.html#view"><tt>paperScope.view</tt></a> will
point to it.</p>
</div>
</div>
</div>
<div id="remove-member" class="member">
<div id="remove-link" class="member-link">
<a name="remove" href="#" onClick="return toggleMember('remove', false);"><tt><b>remove</b>()</tt></a>
</div>
<div id="remove-description" class="member-description hidden">
<div class="member-header">
<div class="member-title">
<div class="member-link">
<a href="#" onClick="return toggleMember('remove', false);"><tt><b>remove</b>()</tt></a>
</div>
</div>
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('remove', false);"></div>
<div class="clear"></div>
</div>
<div class="member-text">
<p>Removes thsi view from the <a href="../classes/PaperScope.html#views"><tt>paperScope.views</tt></a> list and frees the
associated canvas.</p>
</div>
</div>
</div>
<div id="isvisible-member" class="member">
<div id="isvisible-link" class="member-link">
<a name="isvisible" href="#" onClick="return toggleMember('isvisible', false);"><tt><b>isVisible</b>()</tt></a>
@ -444,6 +497,31 @@ viewport.</p>
</div>
</div>
</div>
<div id="draw-member" class="member">
<div id="draw-link" class="member-link">
<a name="draw" href="#" onClick="return toggleMember('draw', false);"><tt><b>draw</b>()</tt></a>
</div>
<div id="draw-description" class="member-description hidden">
<div class="member-header">
<div class="member-title">
<div class="member-link">
<a href="#" onClick="return toggleMember('draw', false);"><tt><b>draw</b>()</tt></a>
</div>
</div>
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('draw', false);"></div>
<div class="clear"></div>
</div>
<div class="member-text">
<p>Draws the view.</p>
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
/*!
* Paper.js v0.2
* Paper.js v0.21
*
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
* based on Scriptographer.org and designed to be largely API compatible.
@ -13,7 +13,7 @@
*
* All rights reserved.
*
* Date: Mon Aug 1 12:03:23 2011 +0100
* Date: Tue Aug 2 10:08:08 2011 +0100
*
***
*
@ -303,9 +303,12 @@ this.Base = Base.inject({
toString: function() {
return '{ ' + Base.each(this, function(value, key) {
var type = typeof value;
this.push(key + ': ' + (type === 'number' ? Base.formatNumber(value)
: type === 'string' ? "'" + value + "'" : value));
if (key.charAt(0) != '_') {
var type = typeof value;
this.push(key + ': ' + (type === 'number'
? Base.formatNumber(value)
: type === 'string' ? "'" + value + "'" : value));
}
}, []).join(', ') + ' }';
},
@ -406,7 +409,7 @@ var PaperScope = this.PaperScope = Base.extend({
PaperScope._scopes[this._id] = this;
},
version: 0.2,
version: 0.21,
evaluate: function(code) {
var res = PaperScript.evaluate(code, this);
@ -476,6 +479,33 @@ var PaperScope = this.PaperScope = Base.extend({
}
});
var PaperScopeItem = Base.extend({
initialize: function(activate) {
this._scope = paper;
this._index = this._scope[this._list].push(this) - 1;
if (activate || !this._scope[this._reference])
this.activate();
},
activate: function() {
if (!this._scope)
return false;
this._scope[this._reference] = this;
return true;
},
remove: function() {
if (this._index == null)
return false;
Base.splice(this._scope[this._list], null, this._index, 1);
if (this._scope[this._reference] == this)
this._scope[this._reference] = null;
this._scope = null;
return true;
}
});
var Point = this.Point = Base.extend({
initialize: function(arg0, arg1) {
if (arg1 !== undefined) {
@ -1623,14 +1653,15 @@ var Line = this.Line = Base.extend({
}
});
var Project = this.Project = Base.extend({
var Project = this.Project = PaperScopeItem.extend({
_list: 'projects',
_reference: 'project',
initialize: function() {
this._scope = paper;
this._index = this._scope.projects.push(this) - 1;
this.base(true);
this._currentStyle = new PathStyle();
this._selectedItems = {};
this._selectedItemCount = 0;
this.activate();
this.layers = [];
this.symbols = [];
this.activeLayer = new Layer();
@ -1649,25 +1680,6 @@ var Project = this.Project = Base.extend({
this._currentStyle.initialize(style);
},
activate: function() {
if (this._scope) {
this._scope.project = this;
return true;
}
return false;
},
remove: function() {
if (this._scope) {
Base.splice(this._scope.projects, null, this._index, 1);
if (this._scope.project == this)
this._scope.project = null;
this._scope = null;
return true;
}
return false;
},
getIndex: function() {
return this._index;
},
@ -6470,12 +6482,16 @@ DomEvent.requestAnimationFrame = new function() {
};
};
var View = this.View = Base.extend({
var View = this.View = PaperScopeItem.extend({
_list: 'views',
_reference: 'view',
initialize: function(canvas) {
this._scope = paper;
this._index = this._scope.views.push(this) - 1;
this.base();
var size;
if (canvas && canvas instanceof HTMLCanvasElement) {
if (typeof canvas === 'string')
canvas = document.getElementById(canvas);
if (canvas instanceof HTMLCanvasElement) {
this._canvas = canvas;
if (PaperScript.hasAttribute(canvas, 'resize')) {
var offset = DomElement.getOffset(canvas, true),
@ -6530,6 +6546,17 @@ var View = this.View = Base.extend({
this._scope._redrawNotified = false;
},
remove: function() {
if (!this.base())
return false;
if (View._focused == this)
View._focused = null;
delete View._views[this._id];
DomEvent.remove(this._canvas, this._events);
this._canvas = this._events = this._onFrame = null;
return true;
},
getCanvas: function() {
return this._canvas;
},
@ -6623,22 +6650,6 @@ var View = this.View = Base.extend({
return true;
},
activate: function() {
this._scope.view = this;
},
remove: function() {
if (this._index == null)
return false;
if (View._focused == this)
View._focused = null;
delete View._views[this._id];
Base.splice(this._scope.views, null, this._index, 1);
DomEvent.remove(this._canvas, this._events);
this._scope = this._canvas = this._events = this._onFrame = null;
return true;
},
projectToView: function(point) {
return this._matrix._transformPoint(Point.read(arguments));
},
@ -7046,9 +7057,12 @@ var ToolEvent = this.ToolEvent = Event.extend({
}
});
var Tool = this.Tool = Base.extend({
var Tool = this.Tool = PaperScopeItem.extend({
_list: 'tools',
_reference: 'tool',
initialize: function() {
this._scope = paper;
this.base();
this._firstMove = true;
this._count = 0;
this._downCount = 0;
@ -7675,7 +7689,7 @@ var parse_js=new function(){function W(a,b,c){var d=[];for(var e=0;e<a.length;++
function evaluate(code, scope) {
paper = scope;
var view = scope.view,
tool = scope.tool = /on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code)
tool = /on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code)
&& new Tool(),
res;
with (scope) {
@ -7723,10 +7737,8 @@ var parse_js=new function(){function W(a,b,c){var d=[];for(var e=0;e<a.length;++
var script = scripts[i];
if (/^text\/(?:x-|)paperscript$/.test(script.type)
&& !script.getAttribute('data-paper-loaded')) {
var canvas = PaperScript.getAttribute(script, 'canvas');
canvas = canvas && document.getElementById(canvas);
var scope = new PaperScope(script);
scope.setup(canvas);
scope.setup(PaperScript.getAttribute(script, 'canvas'));
if (script.src) {
request(script.src, scope);
} else {

122
dist/paper.js vendored
View file

@ -1,5 +1,5 @@
/*!
* Paper.js v0.2
* Paper.js v0.21
*
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
* based on Scriptographer.org and designed to be largely API compatible.
@ -13,7 +13,7 @@
*
* All rights reserved.
*
* Date: Mon Aug 1 12:03:23 2011 +0100
* Date: Tue Aug 2 10:08:08 2011 +0100
*
***
*
@ -303,9 +303,12 @@ this.Base = Base.inject({
toString: function() {
return '{ ' + Base.each(this, function(value, key) {
var type = typeof value;
this.push(key + ': ' + (type === 'number' ? Base.formatNumber(value)
: type === 'string' ? "'" + value + "'" : value));
if (key.charAt(0) != '_') {
var type = typeof value;
this.push(key + ': ' + (type === 'number'
? Base.formatNumber(value)
: type === 'string' ? "'" + value + "'" : value));
}
}, []).join(', ') + ' }';
},
@ -406,7 +409,7 @@ var PaperScope = this.PaperScope = Base.extend({
PaperScope._scopes[this._id] = this;
},
version: 0.2,
version: 0.21,
evaluate: function(code) {
var res = PaperScript.evaluate(code, this);
@ -476,6 +479,33 @@ var PaperScope = this.PaperScope = Base.extend({
}
});
var PaperScopeItem = Base.extend({
initialize: function(activate) {
this._scope = paper;
this._index = this._scope[this._list].push(this) - 1;
if (activate || !this._scope[this._reference])
this.activate();
},
activate: function() {
if (!this._scope)
return false;
this._scope[this._reference] = this;
return true;
},
remove: function() {
if (this._index == null)
return false;
Base.splice(this._scope[this._list], null, this._index, 1);
if (this._scope[this._reference] == this)
this._scope[this._reference] = null;
this._scope = null;
return true;
}
});
var Point = this.Point = Base.extend({
initialize: function(arg0, arg1) {
if (arg1 !== undefined) {
@ -1623,14 +1653,15 @@ var Line = this.Line = Base.extend({
}
});
var Project = this.Project = Base.extend({
var Project = this.Project = PaperScopeItem.extend({
_list: 'projects',
_reference: 'project',
initialize: function() {
this._scope = paper;
this._index = this._scope.projects.push(this) - 1;
this.base(true);
this._currentStyle = new PathStyle();
this._selectedItems = {};
this._selectedItemCount = 0;
this.activate();
this.layers = [];
this.symbols = [];
this.activeLayer = new Layer();
@ -1649,25 +1680,6 @@ var Project = this.Project = Base.extend({
this._currentStyle.initialize(style);
},
activate: function() {
if (this._scope) {
this._scope.project = this;
return true;
}
return false;
},
remove: function() {
if (this._scope) {
Base.splice(this._scope.projects, null, this._index, 1);
if (this._scope.project == this)
this._scope.project = null;
this._scope = null;
return true;
}
return false;
},
getIndex: function() {
return this._index;
},
@ -6470,12 +6482,16 @@ DomEvent.requestAnimationFrame = new function() {
};
};
var View = this.View = Base.extend({
var View = this.View = PaperScopeItem.extend({
_list: 'views',
_reference: 'view',
initialize: function(canvas) {
this._scope = paper;
this._index = this._scope.views.push(this) - 1;
this.base();
var size;
if (canvas && canvas instanceof HTMLCanvasElement) {
if (typeof canvas === 'string')
canvas = document.getElementById(canvas);
if (canvas instanceof HTMLCanvasElement) {
this._canvas = canvas;
if (PaperScript.hasAttribute(canvas, 'resize')) {
var offset = DomElement.getOffset(canvas, true),
@ -6530,6 +6546,17 @@ var View = this.View = Base.extend({
this._scope._redrawNotified = false;
},
remove: function() {
if (!this.base())
return false;
if (View._focused == this)
View._focused = null;
delete View._views[this._id];
DomEvent.remove(this._canvas, this._events);
this._canvas = this._events = this._onFrame = null;
return true;
},
getCanvas: function() {
return this._canvas;
},
@ -6623,22 +6650,6 @@ var View = this.View = Base.extend({
return true;
},
activate: function() {
this._scope.view = this;
},
remove: function() {
if (this._index == null)
return false;
if (View._focused == this)
View._focused = null;
delete View._views[this._id];
Base.splice(this._scope.views, null, this._index, 1);
DomEvent.remove(this._canvas, this._events);
this._scope = this._canvas = this._events = this._onFrame = null;
return true;
},
projectToView: function(point) {
return this._matrix._transformPoint(Point.read(arguments));
},
@ -7046,9 +7057,12 @@ var ToolEvent = this.ToolEvent = Event.extend({
}
});
var Tool = this.Tool = Base.extend({
var Tool = this.Tool = PaperScopeItem.extend({
_list: 'tools',
_reference: 'tool',
initialize: function() {
this._scope = paper;
this.base();
this._firstMove = true;
this._count = 0;
this._downCount = 0;
@ -7675,7 +7689,7 @@ var parse_js=new function(){function W(a,b,c){var d=[];for(var e=0;e<a.length;++
function evaluate(code, scope) {
paper = scope;
var view = scope.view,
tool = scope.tool = /on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code)
tool = /on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code)
&& new Tool(),
res;
with (scope) {
@ -7723,10 +7737,8 @@ var parse_js=new function(){function W(a,b,c){var d=[];for(var e=0;e<a.length;++
var script = scripts[i];
if (/^text\/(?:x-|)paperscript$/.test(script.type)
&& !script.getAttribute('data-paper-loaded')) {
var canvas = PaperScript.getAttribute(script, 'canvas');
canvas = canvas && document.getElementById(canvas);
var scope = new PaperScope(script);
scope.setup(canvas);
scope.setup(PaperScript.getAttribute(script, 'canvas'));
if (script.src) {
request(script.src, scope);
} else {