From 45ef10381fb9ecadb23b5367b7718a1a3abc81ba Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 25 Nov 2019 16:18:45 -0500 Subject: [PATCH] use transformSourceNode to specify the source of transforms, see phetsims/gravity-and-orbits#201 --- js/accessibility/GrabDragInteraction.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/accessibility/GrabDragInteraction.js b/js/accessibility/GrabDragInteraction.js index a60005393..c7f351329 100644 --- a/js/accessibility/GrabDragInteraction.js +++ b/js/accessibility/GrabDragInteraction.js @@ -265,7 +265,8 @@ define( require => { // @private - Make the draggable focusHighlight in the spitting image of the node's this.dragFocusHighlight = new FocusHighlightPath( this.grabFocusHighlight.shape, { - visible: false + visible: false, + transformSourceNode: this.grabFocusHighlight.transformSourceNode || node } ); // Update the passed in node's focusHighlight to make it dashed for the "grabbed" mode @@ -415,7 +416,9 @@ define( require => { if ( node.focusHighlightLayerable ) { assert && assert( this.grabFocusHighlight.parent, 'how can we have focusHighlightLayerable with a ' + 'node that is not in the scene graph?' ); - this.grabFocusHighlight.parent.removeChild( this.dragFocusHighlight ); + if ( this.grabFocusHighlight.parent.hasChild( this.dragFocusHighlight ) ) { + this.grabFocusHighlight.parent.removeChild( this.dragFocusHighlight ); + } } // remove cue references