Skip to content

Commit

Permalink
cleanup: use initializer-list (required gcc >= 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjanetzek committed Jul 27, 2016
1 parent 05265dd commit 49b58e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions core/src/labels/labelProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ struct Anchors {
return anchor == _other.anchor && count == _other.count;
}

// For GCC<5
Anchors(std::array<LabelProperty::Anchor, LabelProperty::max_anchors> _anchor, int _count)
: anchor(_anchor), count(_count) {}

Anchors() : count(0) {}
};

bool anchor(const std::string& _transform, Anchor& _out);
Expand Down
8 changes: 4 additions & 4 deletions core/src/style/textStyleBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,15 @@ TextStyle::Parameters TextStyleBuilder::applyRule(const DrawRule& _rule,

_rule.get(StyleParamKey::text_anchor, p.labelOptions.anchors);
if (p.labelOptions.anchors.count == 0) {
p.labelOptions.anchors = LabelProperty::Anchors({
p.labelOptions.anchors = {{
{LabelProperty::Anchor::bottom,
LabelProperty::Anchor::top,
LabelProperty::Anchor::right,
LabelProperty::Anchor::left,
LabelProperty::Anchor::bottom_right,
LabelProperty::Anchor::bottom_left,
LabelProperty::Anchor::top_right,
LabelProperty::Anchor::top_left}}, 8);
LabelProperty::Anchor::top_left}}, 8};
}
} else {
if (_rule.get(StyleParamKey::priority, priority)) {
Expand All @@ -334,8 +334,8 @@ TextStyle::Parameters TextStyleBuilder::applyRule(const DrawRule& _rule,

_rule.get(StyleParamKey::anchor, p.labelOptions.anchors);
if (p.labelOptions.anchors.count == 0) {
p.labelOptions.anchors = LabelProperty::Anchors({
{LabelProperty::Anchor::center}}, 1);
p.labelOptions.anchors = {{
{LabelProperty::Anchor::center}}, 1};
}
}

Expand Down

0 comments on commit 49b58e3

Please sign in to comment.