mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Replace all mention of DOM in the documentation with scene graph.
This commit is contained in:
parent
e9d575e8b1
commit
44f98ee094
5 changed files with 20 additions and 19 deletions
|
@ -16,7 +16,8 @@ var ChangeFlag = {
|
|||
APPEARANCE: 0x1,
|
||||
// A change in the item's children
|
||||
CHILDREN: 0x2,
|
||||
// A change in the item's place in the DOM (removed, inserted, moved).
|
||||
// A change of the item's place in the scene graph (removed, inserted,
|
||||
// moved).
|
||||
INSERTION: 0x4,
|
||||
// Item geometry (path, bounds)
|
||||
GEOMETRY: 0x8,
|
||||
|
|
|
@ -37,7 +37,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
|
||||
/**
|
||||
* An object constant that can be passed to Item#initialize() to avoid
|
||||
* insertion into the DOM.
|
||||
* insertion into the scene graph.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
|
@ -100,8 +100,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
matrix.translate(point);
|
||||
matrix._owner = this;
|
||||
this._style = new Style(project._currentStyle, this, project);
|
||||
// If _project is already set, the item was already moved into the DOM
|
||||
// hierarchy. Used by Layer, where it's added to project.layers instead
|
||||
// If _project is already set, the item was already moved into the scene
|
||||
// graph. Used by Layer, where it's added to project.layers instead
|
||||
if (!this._project) {
|
||||
// Do not insert into DOM if it's an internal path, if props.insert
|
||||
// is false, or if the props are setting a different parent anyway.
|
||||
|
@ -968,7 +968,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
other._bounds = other._position = undefined;
|
||||
// We need to recursively call _clearBoundsCache, as
|
||||
// when the cache for the other item's children is not
|
||||
// valid anymore, that propagates up the DOM tree.
|
||||
// valid anymore, that propagates up the scene graph.
|
||||
if (other._boundsCache)
|
||||
Item._clearBoundsCache(other);
|
||||
}
|
||||
|
@ -1411,8 +1411,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
* item.
|
||||
*
|
||||
* @param {Boolean} [insert=true] specifies whether the copy should be
|
||||
* inserted into the DOM. When set to `true`, it is inserted above the
|
||||
* original
|
||||
* inserted into the scene graph. When set to `true`, it is inserted
|
||||
* above the original
|
||||
* @return {Item} the newly cloned item
|
||||
*
|
||||
* @example {@paperscript}
|
||||
|
@ -2586,10 +2586,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
},
|
||||
|
||||
/**
|
||||
* Checks whether the item and all its parents are inserted into the DOM or
|
||||
* not.
|
||||
* Checks whether the item and all its parents are inserted into scene graph
|
||||
* or not.
|
||||
*
|
||||
* @return {Boolean} {@true if the item is inserted into the DOM}
|
||||
* @return {Boolean} {@true if the item is inserted into the scene graph}
|
||||
*/
|
||||
isInserted: function() {
|
||||
return this._parent ? this._parent.isInserted() : false;
|
||||
|
@ -3998,8 +3998,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
|
||||
/**
|
||||
* Checks the _updateVersion of the item to see if it got drawn in the draw
|
||||
* loop. If the version is out of sync, the item is either not in the DOM
|
||||
* anymore or is invisible.
|
||||
* loop. If the version is out of sync, the item is either not in the scene
|
||||
* graph anymore or is invisible.
|
||||
*/
|
||||
_isUpdated: function(updateVersion) {
|
||||
var parent = this._parent;
|
||||
|
|
|
@ -160,8 +160,8 @@ var Shape = Item.extend(/** @lends Shape# */{
|
|||
* inherits all settings from it, similar to {@link Item#clone()}.
|
||||
*
|
||||
* @param {Boolean} [insert=true] specifies whether the new path should be
|
||||
* inserted into the DOM. When set to `true`, it is inserted above the
|
||||
* shape item
|
||||
* inserted into the scene graph. When set to `true`, it is inserted
|
||||
* above the shape item
|
||||
* @return {Shape} the newly created path item with the same geometry as
|
||||
* this shape item
|
||||
* @see Path#toShape(insert)
|
||||
|
|
|
@ -1395,8 +1395,8 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
* and inherits all settings from it, similar to {@link Item#clone()}.
|
||||
*
|
||||
* @param {Boolean} [insert=true] specifies whether the new shape should be
|
||||
* inserted into the DOM. When set to `true`, it is inserted above the
|
||||
* path item
|
||||
* inserted into the scene graph. When set to `true`, it is inserted above
|
||||
* the path item
|
||||
* @return {Shape} the newly created shape item with the same geometry as
|
||||
* this path item if it can be matched, `null` otherwise
|
||||
* @see Shape#toPath(insert)
|
||||
|
@ -1586,8 +1586,8 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
// Handle joins / caps that are not round specificelly, by
|
||||
// hit-testing their polygon areas.
|
||||
if (join !== 'round' || cap !== 'round') {
|
||||
// Create an 'internal' path without id and outside the DOM
|
||||
// to run the hit-test on it.
|
||||
// Create an 'internal' path without id and outside the scene
|
||||
// graph to run the hit-test on it.
|
||||
area = new Path({ internal: true, closed: true });
|
||||
if (closed || segment._index > 0
|
||||
&& segment._index < numSegments - 1) {
|
||||
|
|
|
@ -183,7 +183,7 @@ new function() { // Item based mouse handling:
|
|||
}
|
||||
}
|
||||
|
||||
// Bubble up the DOM and find a parent that responds to this event.
|
||||
// Bubble up the parents and call this event until we're told to stop.
|
||||
while (item) {
|
||||
if (call(item, type))
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue