diff options
Diffstat (limited to 'include/mbgl/style/expression/formatted.hpp')
-rw-r--r-- | include/mbgl/style/expression/formatted.hpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/include/mbgl/style/expression/formatted.hpp b/include/mbgl/style/expression/formatted.hpp index 09edad240f..d089e12d9d 100644 --- a/include/mbgl/style/expression/formatted.hpp +++ b/include/mbgl/style/expression/formatted.hpp @@ -1,6 +1,7 @@ #pragma once #include <mbgl/style/conversion.hpp> +#include <mbgl/style/expression/image.hpp> #include <mbgl/util/color.hpp> #include <mbgl/util/font_stack.hpp> #include <mbgl/util/optional.hpp> @@ -17,17 +18,19 @@ extern const char* const kFormattedSectionTextFont; extern const char* const kFormattedSectionTextColor; struct FormattedSection { - FormattedSection(std::string text_, - optional<double> fontScale_, - optional<FontStack> fontStack_, - optional<Color> textColor_) - : text(std::move(text_)) - , fontScale(std::move(fontScale_)) - , fontStack(std::move(fontStack_)) - , textColor(std::move(textColor_)) - {} + explicit FormattedSection(std::string text_, + optional<double> fontScale_, + optional<FontStack> fontStack_, + optional<Color> textColor_) + : text(std::move(text_)), + fontScale(std::move(fontScale_)), + fontStack(std::move(fontStack_)), + textColor(std::move(textColor_)) {} + + explicit FormattedSection(Image image_) : image(std::move(image_)) {} std::string text; + optional<Image> image; optional<double> fontScale; optional<FontStack> fontStack; optional<Color> textColor; @@ -50,10 +53,8 @@ public: std::string toString() const; mbgl::Value toObject() const; - bool empty() const { - return sections.empty() || sections.at(0).text.empty(); - } - + bool empty() const; + std::vector<FormattedSection> sections; }; |