aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guilib/GUIControlFactory.h2
-rw-r--r--guilib/GUIWindow.cpp8
-rw-r--r--guilib/GUIWindow.h1
3 files changed, 3 insertions, 8 deletions
diff --git a/guilib/GUIControlFactory.h b/guilib/GUIControlFactory.h
index 018b945eb7..6867e2635d 100644
--- a/guilib/GUIControlFactory.h
+++ b/guilib/GUIControlFactory.h
@@ -65,6 +65,7 @@ public:
static bool GetMultipleString(const TiXmlNode* pRootNode, const char* strTag, std::vector<CGUIActionDescriptor>& vecStringValue);
static void GetRectFromString(const CStdString &string, CRect &rect);
static bool GetAction(const TiXmlElement* pElement, CGUIActionDescriptor &action);
+ static bool GetHitRect(const TiXmlNode* pRootNode, CRect &rect);
private:
bool GetNavigation(const TiXmlElement *node, const char *tag, int &direction, std::vector<CGUIActionDescriptor> &actions);
bool GetCondition(const TiXmlNode *control, const char *tag, int &condition);
@@ -72,6 +73,5 @@ private:
bool GetString(const TiXmlNode* pRootNode, const char* strTag, CStdString& strString);
bool GetFloatRange(const TiXmlNode* pRootNode, const char* strTag, float& iMinValue, float& iMaxValue, float& iIntervalValue);
bool GetIntRange(const TiXmlNode* pRootNode, const char* strTag, int& iMinValue, int& iMaxValue, int& iIntervalValue);
- bool GetHitRect(const TiXmlNode* pRootNode, CRect &rect);
};
#endif
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp
index df643f540e..896baa0dd0 100644
--- a/guilib/GUIWindow.cpp
+++ b/guilib/GUIWindow.cpp
@@ -145,6 +145,7 @@ bool CGUIWindow::Load(TiXmlDocument &xmlDoc)
CGUIControlFactory::GetMultipleString(pRootElement, "onload", m_loadActions);
CGUIControlFactory::GetMultipleString(pRootElement, "onunload", m_unloadActions);
+ CGUIControlFactory::GetHitRect(pRootElement, m_hitRect);
TiXmlElement *pChild = pRootElement->FirstChildElement();
while (pChild)
@@ -803,6 +804,7 @@ void CGUIWindow::SetDefaults()
m_origins.clear();
m_hasCamera = false;
m_animationsEnabled = true;
+ m_hitRect.SetRect(0, 0, g_settings.m_ResInfo[m_coordsRes].iWidth, g_settings.m_ResInfo[m_coordsRes].iHeight);
}
CRect CGUIWindow::GetScaledBounds() const
@@ -959,9 +961,3 @@ void CGUIWindow::RunUnloadActions()
{
RunActions(m_unloadActions);
}
-
-bool CGUIWindow::HitTest(const CPoint &point) const
-{
- CRect rect(0, 0, m_width, m_height);
- return rect.PtInRect(point - GetPosition());
-}
diff --git a/guilib/GUIWindow.h b/guilib/GUIWindow.h
index db5b275ffb..c5bf51500b 100644
--- a/guilib/GUIWindow.h
+++ b/guilib/GUIWindow.h
@@ -163,7 +163,6 @@ public:
protected:
virtual bool OnMouseEvent(const CPoint &point, const CMouseEvent &event);
- virtual bool HitTest(const CPoint &point) const;
virtual bool LoadXML(const CStdString& strPath, const CStdString &strLowerPath); ///< Loads from the given file
bool Load(TiXmlDocument &xmlDoc); ///< Loads from the given XML document
virtual void LoadAdditionalTags(TiXmlElement *root) {}; ///< Load additional information from the XML document