Skip to content

Commit

Permalink
Fix hand rendering craziness when the hand size gets out of control
Browse files Browse the repository at this point in the history
  • Loading branch information
kiooeht committed Nov 22, 2018
1 parent b117040 commit afb4ef4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,15 @@ public static void PositionCards(CardGroup hand)

float index = 0;
for (AbstractCard card : hand.group) {
card.target_x = Settings.WIDTH / 2.0f + (AbstractCard.IMG_WIDTH_S * 0.5f * (index - middle));
card.targetDrawScale = (1500 * Settings.scale) / (AbstractCard.IMG_WIDTH_S * hand.size());

card.target_x = Settings.WIDTH / 2.0f + (AbstractCard.IMG_WIDTH_S * card.targetDrawScale * (index - middle));
if (card.target_y < 0.0f * Settings.scale) {
card.target_y = 0.0f * Settings.scale;
}
if (Math.abs(card.targetAngle) > 20) {
card.targetAngle = Math.signum(card.targetAngle) * 20.0f;
}
card.targetDrawScale = 0.6375f - (hand.size() - 10) * 0.05f;
index += 1;
}
}
Expand Down

0 comments on commit afb4ef4

Please sign in to comment.