mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Write documentation for Item#anchor.
This commit is contained in:
parent
42788a5bf7
commit
97f7204eab
1 changed files with 18 additions and 4 deletions
|
@ -726,8 +726,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
/**
|
/**
|
||||||
* {@grouptitle Position and Bounding Boxes}
|
* {@grouptitle Position and Bounding Boxes}
|
||||||
*
|
*
|
||||||
* The item's position within the project. This is the
|
* The item's position within the parent item's coordinate system. By
|
||||||
* {@link Rectangle#center} of the item's {@link #bounds} rectangle.
|
* default, this is the {@link Rectangle#center} of the item's
|
||||||
|
* {@link #bounds} rectangle.
|
||||||
*
|
*
|
||||||
* @type Point
|
* @type Point
|
||||||
* @bean
|
* @bean
|
||||||
|
@ -788,8 +789,19 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
this.translate(Point.read(arguments).subtract(this.getPosition(true)));
|
this.translate(Point.read(arguments).subtract(this.getPosition(true)));
|
||||||
},
|
},
|
||||||
|
|
||||||
_anchor: null,
|
/**
|
||||||
|
* The item's anchor point specified in the item coordinate system, defining
|
||||||
|
* the reference point for {@link #position}, as well as the pivot point for
|
||||||
|
* all transformations. By default, it is set to {@code null}, meaning the
|
||||||
|
* {@link Rectangle#center} of the item's {@link #bounds} rectangle is used
|
||||||
|
* as the anchor.
|
||||||
|
*
|
||||||
|
* @type Point
|
||||||
|
* @bean
|
||||||
|
* @default null
|
||||||
|
*
|
||||||
|
* @example {@paperscript}
|
||||||
|
*/
|
||||||
getAnchor: function(/* dontLink */) {
|
getAnchor: function(/* dontLink */) {
|
||||||
var anchor = this._anchor;
|
var anchor = this._anchor;
|
||||||
if (anchor) {
|
if (anchor) {
|
||||||
|
@ -805,6 +817,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
delete this._position;
|
delete this._position;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_anchor: null,
|
||||||
|
|
||||||
// TODO: Keep these around for a bit since it was introduced on the mailing
|
// TODO: Keep these around for a bit since it was introduced on the mailing
|
||||||
// list, then remove in a while.
|
// list, then remove in a while.
|
||||||
getRegistration: '#getAnchor',
|
getRegistration: '#getAnchor',
|
||||||
|
|
Loading…
Reference in a new issue