Skip to content

Commit adace00

Browse files
committed
Initialize LabelInfo with sane default values
1 parent 7724ccf commit adace00

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/WidgetLabel.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ FLARE. If not, see http://www.gnu.org/licenses/
2828

2929
using namespace std;
3030

31+
LabelInfo::LabelInfo() : x(0), y(0), justify(JUSTIFY_LEFT), valign(VALIGN_TOP), hidden(false) {
32+
}
33+
3134
/**
3235
* This is used in menus (e.g. MenuInventory) when parsing their config files
3336
*/

src/WidgetLabel.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ const int VALIGN_CENTER = 0;
3333
const int VALIGN_TOP = 1;
3434
const int VALIGN_BOTTOM = 2;
3535

36-
typedef struct LabelInfo {
36+
struct LabelInfo {
3737
int x,y;
3838
int justify,valign;
3939
bool hidden;
40-
}LabelInfo;
40+
41+
LabelInfo();
42+
};
4143

4244
LabelInfo eatLabelInfo(std::string val);
4345

0 commit comments

Comments
 (0)