WOrking card save loads

This commit is contained in:
Michal Pikulski
2025-11-07 15:06:22 +01:00
parent ba55daa3a7
commit 8c940f4444
2 changed files with 33 additions and 5 deletions

View File

@@ -192,6 +192,20 @@ namespace UI.CardSystem
_placedCard = albumCard;
_isOccupiedPermanently = true;
// Resize the card to match the slot size (same as placed cards)
RectTransform cardRect = albumCard.transform as RectTransform;
RectTransform slotRect = transform as RectTransform;
if (cardRect != null && slotRect != null)
{
// Set height to match slot height (AspectRatioFitter will handle width)
float targetHeight = slotRect.rect.height;
cardRect.sizeDelta = new Vector2(cardRect.sizeDelta.x, targetHeight);
// Ensure position and rotation are centered
cardRect.localPosition = Vector3.zero;
cardRect.localRotation = Quaternion.identity;
}
// Register with AlbumViewPage for enlarge/shrink handling
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
if (albumPage != null)