* Use the adaptative size system for hand representations.
This commit is contained in:
jean.chalard
2009-12-17 18:15:59 +00:00
parent a89458bca8
commit 1d67773097
+9 -3
View File
@@ -97,10 +97,14 @@ void GuiHandSelf::Repos()
{ {
float y = 48.0; float y = 48.0;
if (Closed == state && OptionClosedHand::VISIBLE == options[Options::CLOSEDHAND].number) if (Closed == state && OptionClosedHand::VISIBLE == options[Options::CLOSEDHAND].number)
{
float dist = 180.0 / cards.size(); if (dist > 20) dist = 20.0; else y = 40.0;
cout << dist << endl;
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it) for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
{ {
(*it)->x = ClosedRowX; (*it)->y = y; (*it)->x = ClosedRowX; (*it)->y = y;
y += 20; y += dist;
}
} }
else else
{ {
@@ -108,23 +112,25 @@ void GuiHandSelf::Repos()
if (OptionHandDirection::HORIZONTAL == options[Options::HANDDIRECTION].number) if (OptionHandDirection::HORIZONTAL == options[Options::HANDDIRECTION].number)
{ {
y = SCREEN_WIDTH - 30; y = SCREEN_WIDTH - 30;
float dist = 240.0 / cards.size(); if (dist > 30) dist = 30; else y = SCREEN_WIDTH - 15;
for (vector<CardView*>::reverse_iterator it = cards.rbegin(); it != cards.rend(); ++it) for (vector<CardView*>::reverse_iterator it = cards.rbegin(); it != cards.rend(); ++it)
{ {
(*it)->x = y; (*it)->x = y;
(*it)->y = SCREEN_HEIGHT - 30; (*it)->y = SCREEN_HEIGHT - 30;
y -= 30; y -= dist;
(*it)->alpha = (q ? 0 : 255); (*it)->alpha = (q ? 0 : 255);
} }
backpos.x = y + SCREEN_HEIGHT - 14; backpos.x = y + SCREEN_HEIGHT - 14;
} }
else else
{ {
float dist = 224.0 / ((cards.size() + 1) / 2); if (dist > 65) dist = 65;
bool flip = false; bool flip = false;
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it) for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
{ {
(*it)->x = flip ? RightRowX : LeftRowX; (*it)->x = flip ? RightRowX : LeftRowX;
(*it)->y = y; (*it)->y = y;
if (flip) y += 65; if (flip) y += dist;
flip = !flip; flip = !flip;
(*it)->alpha = (q ? 0 : 255); (*it)->alpha = (q ? 0 : 255);
} }