Skip to content

BackboneDrawable

Overview

A DOM drawable (div element) that contains child blocks (and is placed in the main DOM tree when visible). It should use z-index for properly ordering its blocks in the correct stacking order.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class BackboneDrawable

import { BackboneDrawable } from 'scenerystack/scenery';

Constructor

new BackboneDrawable( display, backboneInstance, transformRootInstance, renderer, isDisplayRoot )

Instance Methods

initialize( display, backboneInstance, transformRootInstance, renderer, isDisplayRoot )

@public

@param {Display} display @param {Instance} backboneInstance @param {Instance} transformRootInstance @param {number} renderer @param {boolean} isDisplayRoot

dispose()

Releases references @public

markBlocksForDisposal()

Dispose all of the blocks while clearing our references to them @public

updateBackboneVisibility()

@private

markForDisposal( display )

Marks this backbone for disposal. @public @override

NOTE: Should be called during syncTree

@param {Display} display

markDirtyDrawable( drawable )

Marks a drawable as dirty. @public

@param {Drawable} drawable

markTransformDirty()

Marks our transform as dirty. @public

onFilterDirty()

Marks our opacity as dirty. @private

onClipDirty()

Marks our clip as dirty. @private

update()

Updates the DOM appearance of this drawable (whether by preparing/calling draw calls, DOM element updates, etc.) @public @override

@returns {boolean} - Whether the update should continue (if false, further updates in supertype steps should not be done).

getFilterVisibility()

Returns the combined visibility of nodes "above us" that will need to be taken into account for displaying this backbone. @public

@returns {boolean}

getFilterClip()

Returns the combined clipArea (string???) for nodes "above us". @public

@returns {string}

reindexBlocks()

Ensures that z-indices are strictly increasing, while trying to minimize the number of times we must change it @public

stitch( firstDrawable, lastDrawable, firstChangeInterval, lastChangeInterval )

Stitches multiple change intervals. @public

@param {Drawable} firstDrawable @param {Drawable} lastDrawable @param {ChangeInterval} firstChangeInterval @param {ChangeInterval} lastChangeInterval

audit( allowPendingBlock, allowPendingList, allowDirty )

Runs checks on the drawable, based on certain flags. @public @override

@param {boolean} allowPendingBlock @param {boolean} allowPendingList @param {boolean} allowDirty

Static Methods

createDivBackbone()

Creates a base DOM element for a backbone. @public

@returns {HTMLDivElement}

repurposeBackboneContainer( element )

Given an external element, we apply the necessary style to make it compatible as a backbone DOM element. @public

@param {HTMLElement} element @returns {HTMLElement} - For chaining

Source Code

See the source for BackboneDrawable.js in the scenery repository.