Skip to content

Commit

Permalink
Actually fix box cell selection image size
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoco007 committed Dec 18, 2023
1 parent 5fd06ec commit c03128b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions BeatSaberMarkupLanguage/Components/CustomListTableData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ public BSMLBoxTableCell InstantiateBoxTableCell(LevelPackCell levelPackTableCell
ImageView coverImage = levelPackTableCell._coverImage;
ImageView selectionImage = levelPackTableCell._selectionImage;

// the cover image isn't perfectly square
coverImage.rectTransform.sizeDelta = new Vector2(0, -1);
selectionImage.rectTransform.sizeDelta = new Vector2(9, 9);
// sizeDelta doesn't work properly when cell size changes
RectTransform selectionRectTransform = selectionImage.rectTransform;
selectionRectTransform.sizeDelta = Vector2.zero;
selectionRectTransform.anchorMin = new Vector2(-0.25f, -0.25f);
selectionRectTransform.anchorMax = new Vector2(1.25f, 1.25f);

foreach (Transform child in coverImage.transform)
{
Expand Down

0 comments on commit c03128b

Please sign in to comment.