Skip to content

Commit

Permalink
fix(app-board): update reset cards translation
Browse files Browse the repository at this point in the history
  • Loading branch information
rams23 committed Jan 24, 2021
1 parent 4e299bd commit ad6d93d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ const CardsGameListeners: React.FC<Props> = ({ onEvent, children, currentGameSta
target: 'panel',
type: GameEventType.CardMovingEnd,
});
translationDeltaRef.current[cardId].x = 0;
translationDeltaRef.current[cardId].y = 0;
if (translationDeltaRef.current[cardId]) {
translationDeltaRef.current[cardId].x = 0;
translationDeltaRef.current[cardId].y = 0;
}
return;
}
const parent = gameStateRef.current[cardId].placedIn;
Expand Down Expand Up @@ -167,8 +169,10 @@ const CardsGameListeners: React.FC<Props> = ({ onEvent, children, currentGameSta
y: (absoluteWindowPosition.y - panAmountRef.current.y + centerAdjustmentY) / boardScaleRef.current,
};
}
translationDeltaRef.current[cardId].x = 0;
translationDeltaRef.current[cardId].y = 0;
if (translationDeltaRef.current[cardId]) {
translationDeltaRef.current[cardId].x = 0;
translationDeltaRef.current[cardId].y = 0;
}

const movementEnd = performance.now();

Expand Down

0 comments on commit ad6d93d

Please sign in to comment.