From 1e2a88e975019929c4c7e3154537865cc09550a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Feb 2020 09:30:51 +0300 Subject: Fix some code style issues --- src/gui/widgets/itemcontainer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/itemcontainer.cpp') 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; -- cgit v1.2.3-60-g2f50