cosmetic: indenting
authorjmarshallnz <jmarshallnz@svn>
Wed, 17 Nov 2010 23:34:01 +0000 (23:34 +0000)
committerjmarshallnz <jmarshallnz@svn>
Wed, 17 Nov 2010 23:34:01 +0000 (23:34 +0000)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35308 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

guilib/GUIBaseContainer.cpp
guilib/GUITextBox.cpp

index 086f3bf..9548444 100644 (file)
@@ -87,58 +87,58 @@ void CGUIBaseContainer::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;
-
-  // we offset our draw position to take into account scrolling and whether or not our focused
-  // item is offscreen "above" the list.
-  float drawOffset = (offset - cacheBefore) * m_layout->Size(m_orientation) - m_scrollOffset;
-  if (m_offset + m_cursor < offset)
-    drawOffset += m_focusedLayout->Size(m_orientation) - m_layout->Size(m_orientation);
-  pos += drawOffset;
-  end += cacheAfter * m_layout->Size(m_orientation);
-
-  float focusedPos = 0;
-  CGUIListItemPtr focusedItem;
-  int current = offset - cacheBefore;
-  while (pos < end && m_items.size())
-  {
-    int itemNo = CorrectOffset(current, 0);
-    if (itemNo >= (int)m_items.size())
-      break;
-    bool focused = (current == m_offset + m_cursor);
-    if (itemNo >= 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;
+
+    // we offset our draw position to take into account scrolling and whether or not our focused
+    // item is offscreen "above" the list.
+    float drawOffset = (offset - cacheBefore) * m_layout->Size(m_orientation) - m_scrollOffset;
+    if (m_offset + m_cursor < offset)
+      drawOffset += m_focusedLayout->Size(m_orientation) - m_layout->Size(m_orientation);
+    pos += drawOffset;
+    end += cacheAfter * m_layout->Size(m_orientation);
+
+    float focusedPos = 0;
+    CGUIListItemPtr focusedItem;
+    int current = offset - cacheBefore;
+    while (pos < end && m_items.size())
     {
-      CGUIListItemPtr item = m_items[itemNo];
-      // render our item
-      if (focused)
-      {
-        focusedPos = pos;
-        focusedItem = item;
-      }
-      else
+      int itemNo = CorrectOffset(current, 0);
+      if (itemNo >= (int)m_items.size())
+        break;
+      bool focused = (current == m_offset + m_cursor);
+      if (itemNo >= 0)
       {
-        if (m_orientation == VERTICAL)
-          RenderItem(origin.x, pos, item.get(), false);
+        CGUIListItemPtr item = m_items[itemNo];
+        // render our item
+        if (focused)
+        {
+          focusedPos = pos;
+          focusedItem = item;
+        }
         else
-          RenderItem(pos, origin.y, item.get(), false);
+        {
+          if (m_orientation == VERTICAL)
+            RenderItem(origin.x, pos, item.get(), false);
+          else
+            RenderItem(pos, origin.y, item.get(), false);
+        }
       }
+      // increment our position
+      pos += focused ? m_focusedLayout->Size(m_orientation) : m_layout->Size(m_orientation);
+      current++;
+    }
+    // render focused item last so it can overlap other items
+    if (focusedItem)
+    {
+      if (m_orientation == VERTICAL)
+        RenderItem(origin.x, focusedPos, focusedItem.get(), true);
+      else
+        RenderItem(focusedPos, origin.y, focusedItem.get(), true);
     }
-    // increment our position
-    pos += focused ? m_focusedLayout->Size(m_orientation) : m_layout->Size(m_orientation);
-    current++;
-  }
-  // render focused item last so it can overlap other items
-  if (focusedItem)
-  {
-    if (m_orientation == VERTICAL)
-      RenderItem(origin.x, focusedPos, focusedItem.get(), true);
-    else
-      RenderItem(focusedPos, origin.y, focusedItem.get(), true);
-  }
 
-  g_graphicsContext.RestoreClipRegion();
+    g_graphicsContext.RestoreClipRegion();
   }
 
   UpdatePageControl(offset);
index 7c6b8cc..5ea6d8e 100644 (file)
@@ -178,34 +178,34 @@ void CGUITextBox::Render()
 
   if (g_graphicsContext.SetClipRegion(m_posX, m_posY, m_width, m_height))
   {
-  // we offset our draw position to take into account scrolling and whether or not our focused
-  // item is offscreen "above" the list.
-  float posX = m_posX;
-  float posY = m_posY + offset * m_itemHeight - m_scrollOffset;
-
-  // alignment correction
-  if (m_label.align & XBFONT_CENTER_X)
-    posX += m_width * 0.5f;
-  if (m_label.align & XBFONT_RIGHT)
-    posX += m_width;
-
-  if (m_font)
-  {
-    m_font->Begin();
-    int current = offset;
-    while (posY < m_posY + m_height && current < (int)m_lines.size())
+    // we offset our draw position to take into account scrolling and whether or not our focused
+    // item is offscreen "above" the list.
+    float posX = m_posX;
+    float posY = m_posY + offset * m_itemHeight - m_scrollOffset;
+
+    // alignment correction
+    if (m_label.align & XBFONT_CENTER_X)
+      posX += m_width * 0.5f;
+    if (m_label.align & XBFONT_RIGHT)
+      posX += m_width;
+
+    if (m_font)
     {
-      uint32_t align = m_label.align;
-      if (m_lines[current].m_text.size() && m_lines[current].m_carriageReturn)
-        align &= ~XBFONT_JUSTIFIED; // last line of a paragraph shouldn't be justified
-      m_font->DrawText(posX, posY + 2, m_colors, m_label.shadowColor, m_lines[current].m_text, align, m_width);
-      posY += m_itemHeight;
-      current++;
+      m_font->Begin();
+      int current = offset;
+      while (posY < m_posY + m_height && current < (int)m_lines.size())
+      {
+        uint32_t align = m_label.align;
+        if (m_lines[current].m_text.size() && m_lines[current].m_carriageReturn)
+          align &= ~XBFONT_JUSTIFIED; // last line of a paragraph shouldn't be justified
+        m_font->DrawText(posX, posY + 2, m_colors, m_label.shadowColor, m_lines[current].m_text, align, m_width);
+        posY += m_itemHeight;
+        current++;
+      }
+      m_font->End();
     }
-    m_font->End();
-  }
 
-  g_graphicsContext.RestoreClipRegion();
+    g_graphicsContext.RestoreClipRegion();
   }
 
   if (m_pageControl)