Closed veillette closed 7 years ago
What I have learn thus far about this bug:
A couple of line I have question thus far are:
Piece Drag Handler
if ( destinationCell.boundsProperty.value.containsPoint( piece.positionProperty.value ) ) {
piece.cellToProperty.value = destinationCell;
}
else {
piece.animateToAndFrom( piece.positionProperty.value, IntroConstants.BUCKET_POSITION );
options.startDrag();
Piece
var animationTween = new TWEEN.Tween( location )
.to( { x: finalPosition.x, y: finalPosition.y },
distance * 5 )
.easing( TWEEN.Easing.Cubic.InOut )
.onUpdate( function() {
self.positionProperty.value = new Vector2( location.x, location.y );
} )
.onComplete( function() {
options.onComplete();
// the piece can be removed from the pieces observable array
self.reachedDestinationEmitter.emit();
} );
animationTween.start( phet.joist.elapsedTime );
}
else {
// for cases where the distance is zero
// optional call back
options.onComplete();
// the piece can be removed from the pieces observable array
self.reachedDestinationEmitter.emit();
So in conclusion this bug most likely have something to do with the isFIlledProperty of that cell. But I still do not understand have the centerPostion or if we drag it affect this bug.
The bug was an unnecessary if statement. Took it out and it fixed the bug. Assigning to @veillette for review.
This issue is stale since we used @jonathanolson prototype.
In vertical bar representation, clicking on a cell (without dragging) generate a piece that flies to the bucket. However the filled cell does not get toggle to empty, allowing it to be clicked again.