diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-10 17:19:24 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-01-10 17:20:33 +0100 |
commit | f5a394a5051384a930d635da22ccafc6beb1cb84 (patch) | |
tree | d28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/gui/itemcontainer.cpp | |
parent | 5757066312cab082378dbc5d8df97dea3fe40af0 (diff) | |
download | mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2 mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.zip |
Change code style
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r-- | src/gui/itemcontainer.cpp | 16 |
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: |