-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CT: Assertion failed: Attempted to attach to an already attached pointer #250
Comments
Reproduced locally in ph-scale and ph-scale-basic, by running from phetmarks with:
Unfortunately the stack trace is not more specific than what's shown above. I can't tell which of several KeyboardDragListeners is failing. |
Running with |
The KeyboardDragListeners are very straightforward. MacroPHMeterNode.ts: this.addInputListener( new KeyboardDragListener( {
dragVelocity: 300, // velocity of the Node being dragged, in view coordinates per second
shiftDragVelocity: 20, // velocity with the Shift key pressed, typically slower than dragVelocity
positionProperty: probe.positionProperty,
dragBoundsProperty: dragBoundsProperty,
transform: modelViewTransform,
tandem: providedOptions.tandem.createTandem( 'keyboardDragListener' )
} ) ); PHDropperNode.ts: this.addInputListener( new KeyboardDragListener( {
dragVelocity: 300, // velocity of the Node being dragged, in view coordinates per second
shiftDragVelocity: 20, // velocity with the Shift key pressed, typically slower than dragVelocity
positionProperty: dropper.positionProperty,
dragBoundsProperty: new Property( dropper.dragBounds ),
transform: modelViewTransform,
tandem: options.tandem.createTandem( 'keyboardDragListener' )
} ) ); The failure occurs at line 271 in KeyboardDragListener.ts: // If there are no movement keys down, attach a listener to the Pointer that will tell the AnimatedPanZoomListener
// to keep this Node in view
if ( !this.movementKeysDown && KeyboardUtils.isMovementKey( event.domEvent ) ) {
assert && assert( this._pointer === null, 'We should have cleared the Pointer reference by now.' );
this._pointer = event.pointer as PDOMPointer;
271 event.pointer.addInputListener( this._pointerListener, true );
}
The comments indicate that this bit of code in KeyboardDragListener is related to pan/zoom, and git history identifies @jessegreenberg as the author. @jessegreenberg could you have a look please? |
Sorry you ran into this, but this problem was fixed with phetsims/scenery#1461. I let the sim fuzz for 15 min with |
Confirmed - CT is no longer reporting this problem, and I can no longer reproduce locally. Thanks for the quick fix! Closing. |
This is undoubtedly related to #249, where KeyboardDragListeners were added for alt input.
Note that CT is reporting this for ph-scale-basics, but not ph-scale. But 99.9% of the code lives in ph-scale.
The text was updated successfully, but these errors were encountered: