Card manipulation tweaks. Don't update the positions of moving cards.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3502 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2005-04-19 18:23:59 +00:00
parent 024bc8afe1
commit ed670dd4ba
@@ -734,7 +734,9 @@ public abstract class CardPanel extends VirtualMediaPanel
int size = _handSprites.size(); int size = _handSprites.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
CardSprite cs = (CardSprite)_handSprites.get(i); CardSprite cs = (CardSprite)_handSprites.get(i);
cs.setLocation(cs.getX(), getHandY(cs)); if (cs.getPath() != null) {
cs.setLocation(cs.getX(), getHandY(cs));
}
} }
} }
@@ -778,7 +780,7 @@ public abstract class CardPanel extends VirtualMediaPanel
*/ */
protected boolean isSelectable (CardSprite sprite) protected boolean isSelectable (CardSprite sprite)
{ {
return _handSelectionMode != NONE && sprite.getPath() == null && return _handSelectionMode != NONE &&
(_handSelectionPredicate == null || (_handSelectionPredicate == null ||
_handSelectionPredicate.evaluate(sprite)); _handSelectionPredicate.evaluate(sprite));
} }
@@ -909,8 +911,7 @@ public abstract class CardPanel extends VirtualMediaPanel
{ {
public void pathCompleted (Sprite sprite, Path path, long when) public void pathCompleted (Sprite sprite, Path path, long when)
{ {
// update the offset maybeUpdateOffset((CardSprite)sprite);
updateOffset((CardSprite)sprite);
} }
public void cardSpriteClicked (CardSprite sprite, MouseEvent me) public void cardSpriteClicked (CardSprite sprite, MouseEvent me)
@@ -932,22 +933,21 @@ public abstract class CardPanel extends VirtualMediaPanel
public void cardSpriteEntered (CardSprite sprite, MouseEvent me) public void cardSpriteEntered (CardSprite sprite, MouseEvent me)
{ {
// update the offset maybeUpdateOffset(sprite);
updateOffset(sprite);
} }
public void cardSpriteExited (CardSprite sprite, MouseEvent me) public void cardSpriteExited (CardSprite sprite, MouseEvent me)
{ {
// update the offset maybeUpdateOffset(sprite);
updateOffset(sprite);
} }
public void cardSpriteDragged (CardSprite sprite, MouseEvent me) public void cardSpriteDragged (CardSprite sprite, MouseEvent me)
{} {}
protected void updateOffset (CardSprite sprite) protected void maybeUpdateOffset (CardSprite sprite)
{ {
if (_handSprites.contains(sprite)) { // update the offset if it's in the hand and isn't moving
if (_handSprites.contains(sprite) && sprite.getPath() == null) {
sprite.setLocation(sprite.getX(), getHandY(sprite)); sprite.setLocation(sprite.getX(), getHandY(sprite));
} }
} }