Skip to content

Commit

Permalink
add missing tandems, phetsims/my-solar-system#237
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Nov 2, 2023
1 parent 08ecb1e commit f482440
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/view/BodyNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,16 @@ export default class BodyNode extends InteractiveHighlighting( ShadedSphereNode
// Constrain dragging for DragListener and KeyboardDragListener.
const map = ( point: Vector2 ) => options.mapPosition( point, this.radius );

const bodyDragListener = new DragListener( {
const dragListener = new DragListener( {
positionProperty: body.positionProperty,
transform: modelViewTransformProperty,
mapPosition: map,
start: start,
end: end,
canStartPress: () => !body.userIsControllingPositionProperty.value
canStartPress: () => !body.userIsControllingPositionProperty.value,
tandem: options.tandem.createTandem( 'dragListener' )
} );
this.addInputListener( bodyDragListener );
this.addInputListener( dragListener );

const keyboardDragListener = new KeyboardDragListener( {
positionProperty: body.positionProperty,
Expand All @@ -204,7 +205,8 @@ export default class BodyNode extends InteractiveHighlighting( ShadedSphereNode
start: start,
end: end,
dragVelocity: options.dragVelocity,
shiftDragVelocity: options.shiftDragVelocity
shiftDragVelocity: options.shiftDragVelocity,
tandem: options.tandem.createTandem( 'keyboardDragListener' )
} );
this.addInputListener( keyboardDragListener );
}
Expand Down

1 comment on commit f482440

@pixelzoom
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.