diff options
Diffstat (limited to 'src/mbgl/text/tagged_string.cpp')
-rw-r--r-- | src/mbgl/text/tagged_string.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mbgl/text/tagged_string.cpp b/src/mbgl/text/tagged_string.cpp index 851e011c4f..8c4e3b02e8 100644 --- a/src/mbgl/text/tagged_string.cpp +++ b/src/mbgl/text/tagged_string.cpp @@ -1,11 +1,12 @@ #include <mbgl/text/tagged_string.hpp> +#include <mbgl/math/minmax.hpp> #include <mbgl/util/i18n.hpp> namespace mbgl { -void TaggedString::addSection(const std::u16string& sectionText, double scale, FontStackHash fontStack) { +void TaggedString::addSection(const std::u16string& sectionText, double scale, FontStack fontStack, optional<Color> textColor) { styledText.first += sectionText; - sections.emplace_back(scale, fontStack); + sections.emplace_back(scale, fontStack, std::move(textColor)); styledText.second.resize(styledText.first.size(), sections.size() - 1); } @@ -26,7 +27,7 @@ void TaggedString::trim() { double TaggedString::getMaxScale() const { double maxScale = 0.0; for (std::size_t i = 0; i < styledText.first.length(); i++) { - maxScale = std::max(maxScale, getSection(i).scale); + maxScale = util::max(maxScale, getSection(i).scale); } return maxScale; } |