summaryrefslogtreecommitdiff
path: root/src/gui/widgets/layout.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-12 19:05:20 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-12 19:05:32 +0300
commitf1e49b8efc717d2cc10ec381b06e40ea027c59da (patch)
treed1040f63ffe3ca95eb8c39ed2cdfd590f99c42c3 /src/gui/widgets/layout.cpp
parente17684f0666d3d17f9c468dab478d3992a633600 (diff)
downloadmanaverse-f1e49b8efc717d2cc10ec381b06e40ea027c59da.tar.gz
manaverse-f1e49b8efc717d2cc10ec381b06e40ea027c59da.tar.bz2
manaverse-f1e49b8efc717d2cc10ec381b06e40ea027c59da.tar.xz
manaverse-f1e49b8efc717d2cc10ec381b06e40ea027c59da.zip
improve layout.
Diffstat (limited to 'src/gui/widgets/layout.cpp')
-rw-r--r--src/gui/widgets/layout.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index 9f0f761cd..2e4f7c5b3 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -236,6 +236,8 @@ void LayoutArray::align(int &pos, int &size, const int dim,
LayoutCell const &cell, const int *const sizes,
const int sizeCount) const
{
+ if (dim < 0 || dim >= 2)
+ return;
int size_max = sizes[0];
int cnt = cell.mExtent[dim];
if (sizeCount && cell.mExtent[dim] > sizeCount)
@@ -266,6 +268,9 @@ void LayoutArray::align(int &pos, int &size, const int dim,
std::vector<int> LayoutArray::getSizes(const int dim, int upp) const
{
+ if (dim < 0 || dim >= 2)
+ return mSizes[1];
+
const int gridW = static_cast<int>(mSizes[0].size());
const int gridH = static_cast<int>(mSizes[1].size());
std::vector<int> sizes = mSizes[dim];