Fix face attributes to string conversion with F shorthand

Previously a `F` attribute would end up being converted to Ffga which
is confusing as F *means* fga.
This commit is contained in:
Maxime Coste 2020-08-30 10:12:21 +10:00
parent 9a7d8df447
commit f56c1107e0

View File

@ -76,8 +76,12 @@ String to_string(Attribute attributes)
}; };
auto filteredAttrs = attrs | auto filteredAttrs = attrs |
filter([=](const Attr& a) { return attributes & a.attr; }) | filter([&](const Attr& a) {
transform([](const Attr& a) { return a.name; }); if ((attributes & a.attr) != a.attr)
return false;
attributes &= ~a.attr;
return true;
}) | transform([](const Attr& a) { return a.name; });
return accumulate(filteredAttrs, "+"_str, std::plus<>{}); return accumulate(filteredAttrs, "+"_str, std::plus<>{});
} }