Game Development Reference
In-Depth Information
_rebuildCache = false;
}
else
{
foreach (TextureThumbnail thumbnail in ThumbnailPanel.Controls)
{
_thumbnails.Add(thumbnail);
}
ThumbnailPanel.Controls.Clear();
}
int numberHorizontal = -1;
foreach (TextureThumbnail thumbnail in _thumbnails)
{
if (numberHorizontal < 0)
{
// determine how many thumbnails can be displayed on one row
numberHorizontal = (int)(ThumbnailPanel.Width / (thumbnail.Width != 0
? thumbnail.Width : 1));
if (numberHorizontal <= 0)
numberHorizontal = 1;
}
thumbnail.Left = _margin + (thumbnail.Width + _margin)
* (ThumbnailPanel.Controls.Count %
numberHorizontal);
thumbnail.Top = _margin + (thumbnail.Height + _margin)
* (ThumbnailPanel.Controls.Count /
numberHorizontal);
ThumbnailPanel.Controls.Add(thumbnail);
}
if (_applyAppearance)
{
foreach (TextureThumbnail thumbnail in ThumbnailPanel.Controls)
{
if (thumbnail.Selected)
Search Nedrilad ::




Custom Search