From 73a48a11e9f974ad99eaf0b751a40d4b701f9193 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 27 Apr 2005 20:36:48 +0000 Subject: [PATCH] To avoid having cards bounce up and down when you hold the mouse cursor near the bottom of the hand, don't update the active sprite every frame; rather, only update it at certain key times. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3526 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/parlor/card/client/CardPanel.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/parlor/card/client/CardPanel.java b/src/java/com/threerings/parlor/card/client/CardPanel.java index 7a932e23e..e1d7c1189 100644 --- a/src/java/com/threerings/parlor/card/client/CardPanel.java +++ b/src/java/com/threerings/parlor/card/client/CardPanel.java @@ -365,6 +365,9 @@ public abstract class CardPanel extends VirtualMediaPanel addSprite(cs); cs.fadeIn(i * cardDuration, cardDuration); } + + // make sure we have the right card sprite active + updateActiveCardSprite(); } /** @@ -746,6 +749,9 @@ public abstract class CardPanel extends VirtualMediaPanel */ protected void updateHandOffsets () { + // make active card sprite is up-to-date + updateActiveCardSprite(); + int size = _handSprites.size(); for (int i = 0; i < size; i++) { CardSprite cs = (CardSprite)_handSprites.get(i); @@ -871,15 +877,6 @@ public abstract class CardPanel extends VirtualMediaPanel } } - // Documentation inherited. - protected void didTick (long tickStamp) - { - super.didTick(tickStamp); - - // update active card sprite - updateActiveCardSprite(); - } - /** * Updates the active card sprite based on the location of the mouse * pointer. @@ -974,6 +971,7 @@ public abstract class CardPanel extends VirtualMediaPanel { public void pathCompleted (Sprite sprite, Path path, long when) { + updateActiveCardSprite(); maybeUpdateOffset((CardSprite)sprite); }