mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Added two asserts to ComponentGrid to check for invalid grid layouts.
This commit is contained in:
parent
4cf291798a
commit
f8c10c539d
|
@ -38,6 +38,8 @@ ComponentGrid::~ComponentGrid()
|
||||||
|
|
||||||
float ComponentGrid::getColWidth(int col)
|
float ComponentGrid::getColWidth(int col)
|
||||||
{
|
{
|
||||||
|
assert(col >= 0 && col < mGridSize.x);
|
||||||
|
|
||||||
if (mColWidths[col] != 0)
|
if (mColWidths[col] != 0)
|
||||||
return mColWidths[col] * mSize.x;
|
return mColWidths[col] * mSize.x;
|
||||||
|
|
||||||
|
@ -55,6 +57,8 @@ float ComponentGrid::getColWidth(int col)
|
||||||
|
|
||||||
float ComponentGrid::getRowHeight(int row)
|
float ComponentGrid::getRowHeight(int row)
|
||||||
{
|
{
|
||||||
|
assert(row >= 0 && row < mGridSize.y);
|
||||||
|
|
||||||
if (mRowHeights[row] != 0)
|
if (mRowHeights[row] != 0)
|
||||||
return mRowHeights[row] * mSize.y;
|
return mRowHeights[row] * mSize.y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue