Additional debugging tools are available in this project, such as:
dispatchEvent
method_dirty
or _layoutDirty
flagsEach of these features is identified by a name and can be individually toggled and queried to check if they are enabled. All of the available features, called debug features, can also be listed.
These features create additional overhead, even when disabled. Because of this,
the debugging tools are implemented as wrappers for method calls, and are
injected at runtime when needed. The wrappers can be injected by calling the
injectDebugCode
function, which must first be imported. When the code is
injected, a new global object (canvasDebug
) is available in the console and a
help message is printed to the console. This object has the following functions:
canvasDebug.list()
: Print a list of all of the available debug featurescanvasDebug.toggle(debugFeature, enable)
: Toggle a debug feature identified by the debugFeature
argument. enabled
is an optional boolean argument; if set, then the feature is enabled or disabled depending on whether the argument is true
or false
, but if not set, then the feature is toggledcanvasDebug.enabled(debugFeature)
: Check whether a debug feature identified by the debugFeature
argument is enabled. Returns true if enabled, false if notThese 3 functions can also be imported via the listDebugFeatures
,
toggleDebugFeature
and isDebugFeatureEnabled
functions, but
injectDebugCode
must still be called before using these functions.
Generated using TypeDoc