-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,25 +6,22 @@ | |
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
|
||
import { scenery } from '../../imports.js'; | ||
import { PDOMInstance, scenery, Trail } from '../../imports.js'; | ||
|
||
class PartialPDOMTrail { | ||
/** | ||
* @param {PDOMInstance} pdomInstance | ||
* @param {Trail} trail | ||
* @param {boolean} isRoot | ||
*/ | ||
constructor( pdomInstance, trail, isRoot ) { | ||
export default class PartialPDOMTrail { | ||
|
||
// @public | ||
this.pdomInstance = pdomInstance; | ||
this.trail = trail; | ||
// a full Trail (rooted at our display) to our trail's final node. | ||
public readonly fullTrail: Trail; | ||
|
||
public constructor( | ||
public readonly pdomInstance: PDOMInstance, | ||
public readonly trail: Trail, | ||
public readonly isRoot: boolean // TODO: remove this, since it can be computed from the pdomInstance https://github.com/phetsims/scenery/issues/1581 | ||
) { | ||
|
||
// TODO: remove this, since it can be computed from the pdomInstance https://github.com/phetsims/scenery/issues/1581 | ||
this.isRoot = isRoot; | ||
this.fullTrail = this.pdomInstance.trail!.copy(); | ||
|
||
// @public {Trail} - a full Trail (rooted at our display) to our trail's final node. | ||
this.fullTrail = this.pdomInstance.trail.copy(); | ||
// NOTE: Only if the parent instance is the root instance do we want to include our partial trail's root. | ||
// For other instances, this node in the trail will already be included | ||
// TODO: add Trail.concat() https://github.com/phetsims/scenery/issues/1581 | ||
|
@@ -34,5 +31,4 @@ class PartialPDOMTrail { | |
} | ||
} | ||
|
||
scenery.register( 'PartialPDOMTrail', PartialPDOMTrail ); | ||
export default PartialPDOMTrail; | ||
scenery.register( 'PartialPDOMTrail', PartialPDOMTrail ); |