Skip to content

Commit 61ba0b7

Browse files
committed
Use ExpandArea() instead of custom and flawed code to achieve the same in MythUIStateType. Potentially fixes a few drawing bugs.
(cherry picked from commit b25ec2e)
1 parent 4a113b0 commit 61ba0b7

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

mythtv/libs/libmythui/mythuistatetype.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ bool MythUIStateType::AddObject(const QString &name, MythUIType *object)
5151
else
5252
objectArea.CalculateArea(GetMythMainWindow()->GetUIScreenRect());
5353

54-
if (objectArea.width() > m_Area.width() ||
55-
objectArea.height() > m_Area.height())
56-
{
57-
m_Area.setWidth(objectArea.getWidth());
58-
m_Area.setHeight(objectArea.getHeight());
59-
}
54+
ExpandArea(objectArea);
6055

6156
return true;
6257
}
@@ -88,12 +83,7 @@ bool MythUIStateType::AddObject(StateType type, MythUIType *object)
8883
else
8984
objectArea.CalculateArea(GetMythMainWindow()->GetUIScreenRect());
9085

91-
if (objectArea.width() > m_Area.width() ||
92-
objectArea.height() > m_Area.height())
93-
{
94-
m_Area.setWidth(objectArea.getWidth());
95-
m_Area.setHeight(objectArea.getHeight());
96-
}
86+
ExpandArea(objectArea);
9787

9888
return true;
9989
}
@@ -104,7 +94,7 @@ bool MythUIStateType::DisplayState(const QString &name)
10494
return false;
10595

10696
MythUIType *old = m_CurrentState;
107-
97+
10898
QMap<QString, MythUIType *>::Iterator i = m_ObjectsByName.find(name.toLower());
10999
if (i != m_ObjectsByName.end())
110100
m_CurrentState = i.value();

0 commit comments

Comments
 (0)