diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-02-13 22:29:22 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-02-13 22:29:22 +0000 |
commit | c74f39d9ff5f3757ac4a826b53e2c2c50ec359f3 (patch) | |
tree | cfbd9c6498407c6215ffe597b5115012e8ce1f62 /guilib/GUIPanelContainer.cpp | |
parent | ca8904b914bdc21b921c9173508f14835d2a28bf (diff) |
added: Ticket #7062 - <offsetx>,<offsety> to containers, allowing rendering of the items to start offset from the container origin. Allows focused sizing larger than nonfocused sizing in panels and lists without cropping
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27736 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIPanelContainer.cpp')
-rw-r--r-- | guilib/GUIPanelContainer.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/guilib/GUIPanelContainer.cpp b/guilib/GUIPanelContainer.cpp index 50d493efb6..0a8bbd52dd 100644 --- a/guilib/GUIPanelContainer.cpp +++ b/guilib/GUIPanelContainer.cpp @@ -58,7 +58,9 @@ void CGUIPanelContainer::Render() FreeMemory(CorrectOffset(offset - cacheBefore, 0), CorrectOffset(offset + cacheAfter + m_itemsPerPage + 1, 0)); g_graphicsContext.SetClipRegion(m_posX, m_posY, m_width, m_height); - float pos = (m_orientation == VERTICAL) ? m_posY : m_posX; + float posX = m_posX + m_renderOffset.x; + float posY = m_posY + m_renderOffset.y; + float pos = (m_orientation == VERTICAL) ? posY : posX; float end = (m_orientation == VERTICAL) ? m_posY + m_height : m_posX + m_width; pos += (offset - cacheBefore) * m_layout->Size(m_orientation) - m_scrollOffset; end += cacheAfter * m_layout->Size(m_orientation); @@ -86,9 +88,9 @@ void CGUIPanelContainer::Render() else { if (m_orientation == VERTICAL) - RenderItem(m_posX + col * m_layout->Size(HORIZONTAL), pos, item.get(), false); + RenderItem(posX + col * m_layout->Size(HORIZONTAL), pos, item.get(), false); else - RenderItem(pos, m_posY + col * m_layout->Size(VERTICAL), item.get(), false); + RenderItem(pos, posY + col * m_layout->Size(VERTICAL), item.get(), false); } } // increment our position @@ -105,9 +107,9 @@ void CGUIPanelContainer::Render() if (focusedItem) { if (m_orientation == VERTICAL) - RenderItem(m_posX + focusedCol * m_layout->Size(HORIZONTAL), focusedPos, focusedItem.get(), true); + RenderItem(posX + focusedCol * m_layout->Size(HORIZONTAL), focusedPos, focusedItem.get(), true); else - RenderItem(focusedPos, m_posY + focusedCol * m_layout->Size(VERTICAL), focusedItem.get(), true); + RenderItem(focusedPos, posY + focusedCol * m_layout->Size(VERTICAL), focusedItem.get(), true); } g_graphicsContext.RestoreClipRegion(); |