Skip to content

Commit

Permalink
cosmetic - align code block
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Marshall committed Apr 3, 2012
1 parent 3343e3a commit 893f11f
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions xbmc/guilib/GUIPanelContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,60 +110,60 @@ void CGUIPanelContainer::Render()

if (g_graphicsContext.SetClipRegion(m_posX, m_posY, m_width, m_height))
{
CPoint origin = CPoint(m_posX, m_posY) + m_renderOffset;
float pos = (m_orientation == VERTICAL) ? origin.y : origin.x;
float end = (m_orientation == VERTICAL) ? m_posY + m_height : m_posX + m_width;
pos += (offset - cacheBefore) * m_layout->Size(m_orientation) - m_scroller.GetValue();
end += cacheAfter * m_layout->Size(m_orientation);

float focusedPos = 0;
int focusedCol = 0;
CGUIListItemPtr focusedItem;
int current = (offset - cacheBefore) * m_itemsPerRow;
int col = 0;
while (pos < end && m_items.size())
{
if (current >= (int)m_items.size())
break;
if (current >= 0)
CPoint origin = CPoint(m_posX, m_posY) + m_renderOffset;
float pos = (m_orientation == VERTICAL) ? origin.y : origin.x;
float end = (m_orientation == VERTICAL) ? m_posY + m_height : m_posX + m_width;
pos += (offset - cacheBefore) * m_layout->Size(m_orientation) - m_scroller.GetValue();
end += cacheAfter * m_layout->Size(m_orientation);

float focusedPos = 0;
int focusedCol = 0;
CGUIListItemPtr focusedItem;
int current = (offset - cacheBefore) * m_itemsPerRow;
int col = 0;
while (pos < end && m_items.size())
{
CGUIListItemPtr item = m_items[current];
bool focused = (current == GetOffset() * m_itemsPerRow + GetCursor()) && m_bHasFocus;
// render our item
if (focused)
if (current >= (int)m_items.size())
break;
if (current >= 0)
{
focusedPos = pos;
focusedCol = col;
focusedItem = item;
CGUIListItemPtr item = m_items[current];
bool focused = (current == GetOffset() * m_itemsPerRow + GetCursor()) && m_bHasFocus;
// render our item
if (focused)
{
focusedPos = pos;
focusedCol = col;
focusedItem = item;
}
else
{
if (m_orientation == VERTICAL)
RenderItem(origin.x + col * m_layout->Size(HORIZONTAL), pos, item.get(), false);
else
RenderItem(pos, origin.y + col * m_layout->Size(VERTICAL), item.get(), false);
}
}
// increment our position
if (col < m_itemsPerRow - 1)
col++;
else
{
if (m_orientation == VERTICAL)
RenderItem(origin.x + col * m_layout->Size(HORIZONTAL), pos, item.get(), false);
else
RenderItem(pos, origin.y + col * m_layout->Size(VERTICAL), item.get(), false);
pos += m_layout->Size(m_orientation);
col = 0;
}
current++;
}
// increment our position
if (col < m_itemsPerRow - 1)
col++;
else
// and render the focused item last (for overlapping purposes)
if (focusedItem)
{
pos += m_layout->Size(m_orientation);
col = 0;
if (m_orientation == VERTICAL)
RenderItem(origin.x + focusedCol * m_layout->Size(HORIZONTAL), focusedPos, focusedItem.get(), true);
else
RenderItem(focusedPos, origin.y + focusedCol * m_layout->Size(VERTICAL), focusedItem.get(), true);
}
current++;
}
// and render the focused item last (for overlapping purposes)
if (focusedItem)
{
if (m_orientation == VERTICAL)
RenderItem(origin.x + focusedCol * m_layout->Size(HORIZONTAL), focusedPos, focusedItem.get(), true);
else
RenderItem(focusedPos, origin.y + focusedCol * m_layout->Size(VERTICAL), focusedItem.get(), true);
}

g_graphicsContext.RestoreClipRegion();
g_graphicsContext.RestoreClipRegion();
}
CGUIControl::Render();
}
Expand Down

0 comments on commit 893f11f

Please sign in to comment.