Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit f2fa2eb

Browse files
authored
Merge pull request #214 from cortex-command-community/version-number
Version number
2 parents 08891fa + 76d8923 commit f2fa2eb

File tree

6 files changed

+131
-122
lines changed

6 files changed

+131
-122
lines changed

GUI/GUILabel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class GUILabel :
191191
// Method: SetHAlignment
192192
//////////////////////////////////////////////////////////////////////////////////////////
193193
// Description: Sets the horizontal alignment of the text of this label.
194-
// Arguments: Teh desired alignement.
194+
// Arguments: The desired alignement.
195195

196196
void SetHAlignment(int HAlignment = GUIFont::Left) { m_HAlignment = HAlignment; }
197197

@@ -200,7 +200,7 @@ class GUILabel :
200200
// Method: SetVAlignment
201201
//////////////////////////////////////////////////////////////////////////////////////////
202202
// Description: Sets the vertical alignment of the text of this label.
203-
// Arguments: Teh desired alignement.
203+
// Arguments: The desired alignement.
204204

205205
void SetVAlignment(int VAlignment = GUIFont::Top) { m_VAlignment = VAlignment; }
206206

@@ -218,7 +218,7 @@ class GUILabel :
218218
// Method: GetVAlignment
219219
//////////////////////////////////////////////////////////////////////////////////////////
220220
// Description: Gets the vertical alignment of the text of this label.
221-
// Arguments: Teh desired alignement.
221+
// Arguments: The desired alignement.
222222

223223
int GetVAlignment() { return m_VAlignment; }
224224

GUI/GUIPanel.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,23 @@ void GUIPanel::AddChild(GUIPanel *child, bool convertToAbsolutePos)
124124
child->m_Height -= (child->m_Y + child->m_Height) - (m_Y + m_Height);
125125
*/
126126
// Make sure the rectangle is valid
127-
child->m_Width = MAX(child->m_Width, 0);
128-
child->m_Height = MAX(child->m_Height, 0);
127+
child->m_Width = std::max(child->m_Width, 0);
128+
child->m_Height = std::max(child->m_Height, 0);
129129

130-
int Z = 0;
131-
// Get the last child in the list
130+
int zPos = 0;
132131
if (m_Children.size() > 0) {
133-
GUIPanel *p = (GUIPanel *)m_Children.at(m_Children.size()-1);
134-
Z = p->GetZPos()+1;
132+
GUIPanel *lastChild = m_Children.back();
133+
zPos = lastChild->GetZPos() + 1;
135134
}
136135

137136
// Remove the child from any previous parent
138-
if (child->GetParentPanel())
139-
child->GetParentPanel()->GUIPanel::RemoveChild(child);
137+
if (child->GetParentPanel()) {
138+
child->GetParentPanel()->GUIPanel::RemoveChild(child);
139+
}
140140

141141
// Setup the inherited values
142142
child->m_Parent = this;
143-
child->Setup(m_Manager, Z);
143+
child->Setup(m_Manager, zPos);
144144

145145
// Add the child to the list
146146
m_Children.push_back(child);

0 commit comments

Comments
 (0)