Skip to content

Commit

Permalink
Add condition to update proposed bead position only when group item i…
Browse files Browse the repository at this point in the history
…s keyboard grabbed, see: #62
  • Loading branch information
marlitas committed Feb 5, 2025
1 parent fefe304 commit 551487e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/common/view/BeadsOnWireNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,10 @@ export default class BeadsOnWireNode extends Node {
} );

// Update the proposed bead position if it does not match the grabbed bead's position.
this.keyboardProposedBeadPositionProperty.value.x !== grabbedBeadNode.countingObject.beadXPositionProperty.value &&
this.keyboardProposedBeadPositionProperty.set( new Vector2( grabbedBeadNode.countingObject.beadXPositionProperty.value, 0 ) );
if ( this.model.groupSelectBeadsModel.isGroupItemKeyboardGrabbedProperty.value ) {
this.keyboardProposedBeadPositionProperty.value.x !== grabbedBeadNode.countingObject.beadXPositionProperty.value &&
this.keyboardProposedBeadPositionProperty.set( new Vector2( grabbedBeadNode.countingObject.beadXPositionProperty.value, 0 ) );
}

assert && assert( this.leftAddendCountingObjectsProperty.value.length === this.model.leftAddendProperty.value, 'leftAddendObjects.length should match leftAddendNumberProperty' );
assert && assert( this.rightAddendCountingObjectsProperty.value.length === this.model.rightAddendProperty.value, 'rightAddendObjects.length should match rightAddendNumberProperty' );
Expand Down

0 comments on commit 551487e

Please sign in to comment.