summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r--src/gui/itemcontainer.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index c8d3ca7d..ff431c31 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -120,12 +120,14 @@ void ItemContainer::draw(gcn::Graphics *graphics)
{
if (itemIndex == mSelectedIndex)
{
- if (mSelectionStatus == SEL_DRAGGING) {
+ if (mSelectionStatus == SEL_DRAGGING)
+ {
// Reposition the coords to that of the cursor.
itemX = mDragPosX - (BOX_WIDTH / 2);
itemY = mDragPosY - (BOX_HEIGHT / 2);
}
- else {
+ else
+ {
// Draw selection border image.
g->drawImage(mSelImg, itemX, itemY);
}
@@ -395,12 +397,10 @@ void ItemContainer::moveHighlight(Direction direction)
{
if (mHighlightedIndex == -1)
{
- if (mSelectedIndex != -1) {
+ if (mSelectedIndex != -1)
mHighlightedIndex = mSelectedIndex;
- }
- else {
+ else
mHighlightedIndex = 0;
- }
return;
}
@@ -408,9 +408,7 @@ void ItemContainer::moveHighlight(Direction direction)
{
case Left:
if (mHighlightedIndex % mGridColumns == 0)
- {
mHighlightedIndex += mGridColumns;
- }
mHighlightedIndex--;
break;
case Right:
@@ -423,9 +421,7 @@ void ItemContainer::moveHighlight(Direction direction)
break;
case Up:
if (mHighlightedIndex / mGridColumns == 0)
- {
mHighlightedIndex += (mGridColumns * mGridRows);
- }
mHighlightedIndex -= mGridColumns;
break;
case Down: