Replace all mention of DOM in the documentation with scene graph.

This commit is contained in:
Jürg Lehni 2015-12-28 21:26:42 +01:00
parent e9d575e8b1
commit 44f98ee094
5 changed files with 20 additions and 19 deletions

View file

@ -16,7 +16,8 @@ var ChangeFlag = {
APPEARANCE: 0x1, APPEARANCE: 0x1,
// A change in the item's children // A change in the item's children
CHILDREN: 0x2, 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, INSERTION: 0x4,
// Item geometry (path, bounds) // Item geometry (path, bounds)
GEOMETRY: 0x8, GEOMETRY: 0x8,

View file

@ -37,7 +37,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/** /**
* An object constant that can be passed to Item#initialize() to avoid * An object constant that can be passed to Item#initialize() to avoid
* insertion into the DOM. * insertion into the scene graph.
* *
* @private * @private
*/ */
@ -100,8 +100,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
matrix.translate(point); matrix.translate(point);
matrix._owner = this; matrix._owner = this;
this._style = new Style(project._currentStyle, this, project); this._style = new Style(project._currentStyle, this, project);
// If _project is already set, the item was already moved into the DOM // If _project is already set, the item was already moved into the scene
// hierarchy. Used by Layer, where it's added to project.layers instead // graph. Used by Layer, where it's added to project.layers instead
if (!this._project) { if (!this._project) {
// Do not insert into DOM if it's an internal path, if props.insert // 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. // 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; other._bounds = other._position = undefined;
// We need to recursively call _clearBoundsCache, as // We need to recursively call _clearBoundsCache, as
// when the cache for the other item's children is not // 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) if (other._boundsCache)
Item._clearBoundsCache(other); Item._clearBoundsCache(other);
} }
@ -1411,8 +1411,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* item. * item.
* *
* @param {Boolean} [insert=true] specifies whether the copy should be * @param {Boolean} [insert=true] specifies whether the copy should be
* inserted into the DOM. When set to `true`, it is inserted above the * inserted into the scene graph. When set to `true`, it is inserted
* original * above the original
* @return {Item} the newly cloned item * @return {Item} the newly cloned item
* *
* @example {@paperscript} * @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 * Checks whether the item and all its parents are inserted into scene graph
* not. * 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() { isInserted: function() {
return this._parent ? this._parent.isInserted() : false; 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 * 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 * loop. If the version is out of sync, the item is either not in the scene
* anymore or is invisible. * graph anymore or is invisible.
*/ */
_isUpdated: function(updateVersion) { _isUpdated: function(updateVersion) {
var parent = this._parent; var parent = this._parent;

View file

@ -160,8 +160,8 @@ var Shape = Item.extend(/** @lends Shape# */{
* inherits all settings from it, similar to {@link Item#clone()}. * inherits all settings from it, similar to {@link Item#clone()}.
* *
* @param {Boolean} [insert=true] specifies whether the new path should be * @param {Boolean} [insert=true] specifies whether the new path should be
* inserted into the DOM. When set to `true`, it is inserted above the * inserted into the scene graph. When set to `true`, it is inserted
* shape item * above the shape item
* @return {Shape} the newly created path item with the same geometry as * @return {Shape} the newly created path item with the same geometry as
* this shape item * this shape item
* @see Path#toShape(insert) * @see Path#toShape(insert)

View file

@ -1395,8 +1395,8 @@ var Path = PathItem.extend(/** @lends Path# */{
* and inherits all settings from it, similar to {@link Item#clone()}. * and inherits all settings from it, similar to {@link Item#clone()}.
* *
* @param {Boolean} [insert=true] specifies whether the new shape should be * @param {Boolean} [insert=true] specifies whether the new shape should be
* inserted into the DOM. When set to `true`, it is inserted above the * inserted into the scene graph. When set to `true`, it is inserted above
* path item * the path item
* @return {Shape} the newly created shape item with the same geometry as * @return {Shape} the newly created shape item with the same geometry as
* this path item if it can be matched, `null` otherwise * this path item if it can be matched, `null` otherwise
* @see Shape#toPath(insert) * @see Shape#toPath(insert)
@ -1586,8 +1586,8 @@ var Path = PathItem.extend(/** @lends Path# */{
// Handle joins / caps that are not round specificelly, by // Handle joins / caps that are not round specificelly, by
// hit-testing their polygon areas. // hit-testing their polygon areas.
if (join !== 'round' || cap !== 'round') { if (join !== 'round' || cap !== 'round') {
// Create an 'internal' path without id and outside the DOM // Create an 'internal' path without id and outside the scene
// to run the hit-test on it. // graph to run the hit-test on it.
area = new Path({ internal: true, closed: true }); area = new Path({ internal: true, closed: true });
if (closed || segment._index > 0 if (closed || segment._index > 0
&& segment._index < numSegments - 1) { && segment._index < numSegments - 1) {

View file

@ -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) { while (item) {
if (call(item, type)) if (call(item, type))
return true; return true;