Skip to content

Commit

Permalink
Revert "fix issue with stacking newly added candy bars, see #323"
Browse files Browse the repository at this point in the history
This reverts commit 5c8d9b8.
  • Loading branch information
marlitas committed Jul 17, 2024
1 parent 33cb39e commit a978361
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions js/distribute/model/DistributeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,10 @@ export default class DistributeModel extends SharingModel<Snack> {

// Initialize the plates and set up plate-related behavior that is specific to the Distribute screen.
this.plates.forEach( plate => {

// Listen for when snacks are added to a plate and make sure they are active and correctly positioned.
plate.snacksOnNotepadPlate.addItemAddedListener( snack => {
snack.isActiveProperty.value = true;
const positionIndex = plate.snacksOnNotepadPlate.filter(
snackOnPlate => snackOnPlate !== snack && !snackOnPlate.draggingProperty.value
).length;
snack.moveTo( plate.getPositionForStackedItem( positionIndex ), this.animateAddedSnacks );
const index = plate.snacksOnNotepadPlate.indexOf( snack );
snack.moveTo( plate.getPositionForStackedItem( index ), this.animateAddedSnacks );
} );

// Start off with the table and notepad quantities in sync.
Expand Down

0 comments on commit a978361

Please sign in to comment.