mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
nicer looking counters
This commit is contained in:
parent
f6849ff02b
commit
2e90a85999
17 changed files with 3054 additions and 13 deletions
|
|
@ -1220,7 +1220,6 @@ void Player::clearArrows()
|
|||
void Player::rearrangeCounters()
|
||||
{
|
||||
qreal marginTop = 80;
|
||||
qreal marginBottom = 10;
|
||||
|
||||
// Determine total height of bounding rectangles
|
||||
qreal totalHeight = 0;
|
||||
|
|
@ -1231,15 +1230,9 @@ void Player::rearrangeCounters()
|
|||
totalHeight += counterIterator.value()->boundingRect().height();
|
||||
}
|
||||
|
||||
// Determine free space between objects
|
||||
qreal padding = (boundingRect().height() - marginTop - marginBottom - totalHeight) / (counters.size() - 1);
|
||||
const qreal padding = 10;
|
||||
qreal y = boundingRect().y() + marginTop;
|
||||
|
||||
if (counters.size() == 1) {
|
||||
padding = 0;
|
||||
y += (boundingRect().height() - marginTop - marginBottom) / 2;
|
||||
}
|
||||
|
||||
// Place objects
|
||||
for (counterIterator.toFront(); counterIterator.hasNext(); ) {
|
||||
AbstractCounter *c = counterIterator.next().value();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue