aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUIWindow.cpp
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-01-09 02:12:30 +0000
committerjmarshallnz <jmarshallnz@svn>2010-01-09 02:12:30 +0000
commitcd1ff654231dd3016703b22d05c1ffc76d4c655c (patch)
treeea244cebb53fc827b01b13acc5000f9fd6434a3a /guilib/GUIWindow.cpp
parent2e370e36232d786c71a86802ef64c301b977b940 (diff)
changed: CGUIWindow::GetOrigin() -> CGUIControlGroup::GetPosition() with override for window <origin> tags. Fixes possible mouse pointer location issues with dialogs using multiple <origin>'s, and provides consistency when reading these coords at the window level
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26566 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIWindow.cpp')
-rw-r--r--guilib/GUIWindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp
index 9c43d48fbc..047f14b2c8 100644
--- a/guilib/GUIWindow.cpp
+++ b/guilib/GUIWindow.cpp
@@ -323,7 +323,7 @@ void CGUIWindow::Render()
g_graphicsContext.SetCameraPosition(m_camera);
// find our origin point
- CPoint pos = GetOrigin();
+ CPoint pos(GetPosition());
g_graphicsContext.SetOrigin(pos.x, pos.y);
for (iControls i = m_children.begin(); i != m_children.end(); ++i)
@@ -364,7 +364,7 @@ bool CGUIWindow::OnAction(const CAction &action)
return false;
}
-CPoint CGUIWindow::GetOrigin()
+CPoint CGUIWindow::GetPosition() const
{
for (unsigned int i = 0; i < m_origins.size(); i++)
{
@@ -374,7 +374,7 @@ CPoint CGUIWindow::GetOrigin()
return CPoint(m_origins[i].x, m_origins[i].y);
}
}
- return CPoint(m_posX, m_posY);
+ return CGUIControlGroup::GetPosition();
}
// OnMouseAction - called by OnAction()
@@ -859,7 +859,8 @@ CRect CGUIWindow::GetScaledBounds() const
{
CSingleLock lock(g_graphicsContext);
g_graphicsContext.SetScalingResolution(m_coordsRes, m_needsScaling);
- CRect rect(m_posX, m_posY, m_posX + m_width, m_posY + m_height);
+ CPoint pos(GetPosition());
+ CRect rect(pos.x, pos.y, pos.x + m_width, pos.y + m_height);
float z = 0;
g_graphicsContext.ScaleFinalCoords(rect.x1, rect.y1, z);
g_graphicsContext.ScaleFinalCoords(rect.x2, rect.y2, z);