mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-29 17:32:17 -07:00
Removed minimized version of the vertical stacking behaviour
The overflow function covers the necessary edge case, the minimized branch of it was an artefact of earlier builds
This commit is contained in:
parent
ae37762ee1
commit
1310ca9bbd
1 changed files with 23 additions and 31 deletions
|
|
@ -21,13 +21,6 @@ SelectZone::ZoneLayout SelectZone::computeZoneLayout(const StackLayoutParams &pa
|
||||||
}
|
}
|
||||||
qreal effectiveOffset = params.desiredOffset;
|
qreal effectiveOffset = params.desiredOffset;
|
||||||
if (params.cardCount > 1) {
|
if (params.cardCount > 1) {
|
||||||
qreal fitOffset;
|
|
||||||
if (params.totalHeight < params.cardHeight && params.minOffset > 0.0) {
|
|
||||||
// Zone is shorter than a card (e.g. minimized). Compress offsets so
|
|
||||||
// every card has at least minOffset pixels of its top visible.
|
|
||||||
fitOffset = (params.totalHeight - params.minOffset) / (params.cardCount - 1);
|
|
||||||
effectiveOffset = qMax(0.0, qMin(params.desiredOffset, fitOffset));
|
|
||||||
} else {
|
|
||||||
qreal reservedForBottomCard;
|
qreal reservedForBottomCard;
|
||||||
if (params.allowBottomOverflow) {
|
if (params.allowBottomOverflow) {
|
||||||
// Allow the bottom card to partially overflow in tight zones, scaling the
|
// Allow the bottom card to partially overflow in tight zones, scaling the
|
||||||
|
|
@ -41,7 +34,7 @@ SelectZone::ZoneLayout SelectZone::computeZoneLayout(const StackLayoutParams &pa
|
||||||
// No overflow: reserve full card height for the bottom card
|
// No overflow: reserve full card height for the bottom card
|
||||||
reservedForBottomCard = params.cardHeight;
|
reservedForBottomCard = params.cardHeight;
|
||||||
}
|
}
|
||||||
fitOffset = (params.totalHeight - reservedForBottomCard) / (params.cardCount - 1);
|
qreal fitOffset = (params.totalHeight - reservedForBottomCard) / (params.cardCount - 1);
|
||||||
|
|
||||||
if (!params.allowBottomOverflow) {
|
if (!params.allowBottomOverflow) {
|
||||||
// Constrain offset so all card tops remain within zone bounds.
|
// Constrain offset so all card tops remain within zone bounds.
|
||||||
|
|
@ -56,7 +49,6 @@ SelectZone::ZoneLayout SelectZone::computeZoneLayout(const StackLayoutParams &pa
|
||||||
effectiveOffset = qMax(params.minOffset, effectiveOffset);
|
effectiveOffset = qMax(params.minOffset, effectiveOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
qreal stackHeight = (params.cardCount - 1) * effectiveOffset + params.cardHeight;
|
qreal stackHeight = (params.cardCount - 1) * effectiveOffset + params.cardHeight;
|
||||||
qreal start = (stackHeight <= params.totalHeight) ? (params.totalHeight - stackHeight) / 2.0 : 0.0;
|
qreal start = (stackHeight <= params.totalHeight) ? (params.totalHeight - stackHeight) / 2.0 : 0.0;
|
||||||
return {effectiveOffset, start};
|
return {effectiveOffset, start};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue