mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-02 19:49:35 -05:00
Dispose of discarded slots when adding new
This commit is contained in:
parent
cc8cbeb749
commit
b01ec96ac8
|
|
@ -17,8 +17,8 @@ public PokeGrid()
|
|||
public readonly List<PictureBox> Entries = new();
|
||||
public int Slots { get; private set; }
|
||||
|
||||
private int sizeW = 40;
|
||||
private int sizeH = 30;
|
||||
private int sizeW = 68;
|
||||
private int sizeH = 56;
|
||||
|
||||
public bool InitializeGrid(int width, int height, SpriteBuilder info)
|
||||
{
|
||||
|
|
@ -44,6 +44,8 @@ private void Generate(int width, int height)
|
|||
{
|
||||
SuspendLayout();
|
||||
Controls.Clear();
|
||||
foreach (var c in Entries)
|
||||
c.Dispose();
|
||||
Entries.Clear();
|
||||
|
||||
int colWidth = sizeW;
|
||||
|
|
@ -77,8 +79,8 @@ public static PictureBox GetControl(int width, int height) => new()
|
|||
AutoSize = false,
|
||||
SizeMode = PictureBoxSizeMode.CenterImage,
|
||||
BackColor = SlotUtil.GoodDataColor,
|
||||
Width = width + (2 * 1),
|
||||
Height = height + (2 * 1),
|
||||
Width = width + (2 * border),
|
||||
Height = height + (2 * border),
|
||||
Padding = Padding.Empty,
|
||||
Margin = Padding.Empty,
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user