summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
committerAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
commit1e2a88e975019929c4c7e3154537865cc09550a6 (patch)
treeae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/widgets/itemcontainer.cpp
parent6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff)
downloadmanaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz
manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2
manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz
manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.zip
Fix some code style issues
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 9c566c9c7..e60e70332 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -365,8 +365,6 @@ void ItemContainer::draw(Graphics *const graphics)
int itemIndex = j * mGridColumns - 1;
for (int i = 0; i < mGridColumns; i++)
{
- int itemX = i * mBoxWidth;
- int itemY = intY0;
itemIndex ++;
if (mShowMatrix[itemIndex] < 0)
continue;
@@ -380,6 +378,8 @@ void ItemContainer::draw(Graphics *const graphics)
Image *const image = item->getImage();
if (image != nullptr)
{
+ int itemX = i * mBoxWidth;
+ int itemY = intY0;
if (mShowMatrix[itemIndex] == mSelectedIndex)
{
if (mSelImg != nullptr)
@@ -487,8 +487,6 @@ void ItemContainer::safeDraw(Graphics *const graphics)
int itemIndex = j * mGridColumns - 1;
for (int i = 0; i < mGridColumns; i++)
{
- int itemX = i * mBoxWidth;
- int itemY = intY0;
itemIndex ++;
if (mShowMatrix[itemIndex] < 0)
continue;
@@ -502,6 +500,8 @@ void ItemContainer::safeDraw(Graphics *const graphics)
Image *const image = item->getImage();
if (image != nullptr)
{
+ int itemX = i * mBoxWidth;
+ int itemY = intY0;
if (mShowMatrix[itemIndex] == mSelectedIndex)
{
if (mSelImg != nullptr)
@@ -1148,9 +1148,9 @@ void ItemContainer::adjustHeight()
mGridRows = maxRows;
}
- const int num = updateMatrix();
if (mShowEmptyRows == ShowEmptyRows_false)
{
+ const int num = updateMatrix();
mDrawRows = num / mGridColumns;
if (mDrawRows == 0 || num % mGridColumns > 0)
++mDrawRows;